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.
30 lines
625 B
30 lines
625 B
<?php
|
|
|
|
|
|
namespace app\jobs\store;
|
|
|
|
use app\services\product\branch\StoreBranchProductServices;
|
|
use crmeb\basic\BaseJobs;
|
|
use crmeb\traits\QueueTrait;
|
|
|
|
/**
|
|
* 门店同步库存队列
|
|
* Class SynchStocksJob
|
|
* @package app\jobs\store
|
|
*/
|
|
class SynchStocksJob extends BaseJobs
|
|
{
|
|
use QueueTrait;
|
|
|
|
public function doJob($ids, $storeId)
|
|
{
|
|
try {
|
|
/** @var StoreBranchProductServices $services */
|
|
$services = app()->make(StoreBranchProductServices::class);
|
|
$services->synchStocks($ids, (int)$storeId);
|
|
} catch (\Throwable $e) {
|
|
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|