// +---------------------------------------------------------------------- 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. } }