29 lines
657 B
PHP
Executable File
29 lines
657 B
PHP
Executable File
<?php
|
|
|
|
namespace crmeb\jobs;
|
|
|
|
use crmeb\interfaces\JobInterface;
|
|
use think\facade\Log;
|
|
use app\common\repositories\store\order\StoreOrderRepository;
|
|
|
|
class ImportProductJob implements JobInterface
|
|
{
|
|
public function fire($job, $data)
|
|
{
|
|
if ($job->attempts() > 1) {
|
|
$job->delete();
|
|
$this->failed($data);
|
|
}
|
|
app()->make(StoreOrderRepository::class)->setProduct($data['data'],$data['mer_id'],$data['product_type']);
|
|
$job->delete();
|
|
}
|
|
|
|
public function failed($data)
|
|
{
|
|
Log::error('导入商品失败:' . json_encode($data));
|
|
// TODO: Implement failed() method.
|
|
}
|
|
|
|
|
|
}
|