You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
8 months ago
|
<?php
|
||
|
declare (strict_types=1);
|
||
|
|
||
|
namespace app\job\controller\goods;
|
||
|
|
||
|
use app\job\service\goods\GoodsUpdateImport as GoodsUpdateImportService;
|
||
|
use cores\BaseJob;
|
||
|
use cores\traits\QueueTrait;
|
||
|
use cores\exception\BaseException;
|
||
|
use think\db\exception\DataNotFoundException;
|
||
|
use think\db\exception\DbException;
|
||
|
use think\db\exception\ModelNotFoundException;
|
||
|
|
||
|
/**
|
||
|
* 队列任务:商品批量导入
|
||
|
* Class Import
|
||
|
* @package app\job\controller
|
||
|
*/
|
||
|
class GoodsUpdateImport extends BaseJob
|
||
|
{
|
||
|
use QueueTrait;
|
||
|
|
||
|
/**
|
||
|
* 消费队列任务:商品导入
|
||
|
* @param array $data 参数 [index队列顺序;totalCount商品总数量;list商品列表;storeId商城ID]
|
||
|
* @return bool 返回结果
|
||
|
* @throws BaseException
|
||
|
* @throws DataNotFoundException
|
||
|
* @throws DbException
|
||
|
* @throws ModelNotFoundException
|
||
|
*/
|
||
|
public function handle(array $data): bool
|
||
|
{
|
||
|
$time = date('H:i:s');
|
||
|
echo "\n ---- adminImport ---- {$time} ---- \n";
|
||
|
|
||
|
$service = new GoodsUpdateImportService;
|
||
|
return $service->batch($data['list'], $data['recordId'], $data['storeId']);
|
||
|
}
|
||
|
}
|