Files
OMS/app/tbo2o/lib/shop/skus/import.php
2025-12-28 23:13:25 +08:00

49 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 关联后端商品导入最终执行Lib类
*
* @author wangbiao@shopex.cn
* @version 0.1
*/
class tbo2o_shop_skus_to_import
{
/**
* 队列任务执行
*
* @param String $cursor_id
* @param Array $params
* @param String $errmsg
* @return Boolean
*/
function run(&$cursor_id,$params,&$errmsg)
{
$importObj = app::get($params['app'])->model($params['mdl']);
$dataSdf = $params['sdfdata'];
foreach ($dataSdf as $v){
$data = array(
'product_id' => $v['product_id'],
'product_bn' => $v['product_bn'],
'product_name' => $v['product_name'],
'is_bind_product' => 1,
);
$is_save = $importObj->update($data, array('id'=>$v['id']));
if(!$is_save)
{
$m = $importObj->db->errorinfo();
if(!empty($m)){
$errmsg.=$m.";";
}
}
}
return false;
}
}