// +---------------------------------------------------------------------- namespace crmeb\jobs; use app\common\repositories\store\product\ProductRepository; use crmeb\interfaces\JobInterface; use think\facade\Log; class ClearMerchantStoreJob implements JobInterface { public function fire($job, $data) { try{ app()->make(ProductRepository::class)->clearMerchantProduct((int)$data['mer_id']); }catch (\Exception $e){ Log::info('商户ID:'.$data['mer_id'].'清除出错'); } $job->delete(); } public function failed($data) { // TODO: Implement failed() method. } }