shop-php/crmeb/jobs/ProductImportJob.php

28 lines
644 B
PHP
Raw Normal View History

2023-05-10 13:38:51 +08:00
<?php
namespace crmeb\jobs;
use app\common\repositories\store\product\ProductRepository;
use crmeb\interfaces\JobInterface;
use think\facade\Log;
class ProductImportJob implements JobInterface
{
public function fire($job, $data)
{
try{
$make = app()->make(ProductRepository::class);
$make->create($data['data'],$data['product_type']);
}catch (\Exception $e){
Log::error('商户ID'.$data['mer_id'].' 导入文件 error : ' . $e->getMessage());
}
$job->delete();
}
public function failed($data)
{
// TODO: Implement failed() method.
}
}