shop-php/crmeb/jobs/ImportProductJob.php
2024-01-26 09:39:36 +08:00

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