48 lines
1.6 KiB
PHP
Executable File
48 lines
1.6 KiB
PHP
Executable File
<?php
|
||
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
|
||
|
||
namespace crmeb\jobs;
|
||
|
||
|
||
use crmeb\interfaces\JobInterface;
|
||
use app\controller\admin\store\StoreProduct;
|
||
use think\facade\Db;
|
||
|
||
/**
|
||
* 本地跑远程线程专门使用
|
||
*/
|
||
class ProductCopyJob implements JobInterface
|
||
{
|
||
|
||
public function fire($job, $data)
|
||
{
|
||
// $arrs= Db::name('store_product')->where('old_product_id',$data['product_id'])->select();
|
||
// foreach($arrs as $it){
|
||
// $res= Db::name('store_product')->where('product_id',$it['product_id'])->update(['is_del'=>1,'is_show'=>0,'is_used'=>0,'status'=>-2]);
|
||
// if($res){
|
||
// Db::name('cloud_product')->where('product_id',$it['product_id'])->delete();
|
||
|
||
// }
|
||
// }
|
||
$make = app()->make(StoreProduct::class);
|
||
$make->copy($data['product_id'],$data['mer_id'],$data['street_code'],$data['type_id'],$data['category_id']);
|
||
$job->delete();
|
||
}
|
||
|
||
|
||
public function failed($data)
|
||
{
|
||
// TODO: Implement failed() method.
|
||
}
|
||
}
|