28 lines
644 B
PHP
28 lines
644 B
PHP
|
<?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.
|
|||
|
}
|
|||
|
}
|