commit
d6ced61036
@ -43,10 +43,10 @@ class Swoole extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
Timer::tick(1000, function () {
|
Timer::tick(5000, function () {
|
||||||
$shops = Shop::query()->where('plat_id', 1)->where('status', 1)->get();
|
$shops = Shop::query()->where('plat_id', 1)->where('status', 1)->get();
|
||||||
$endTime = DateTimeUtils::getMicroTime();
|
$endTime = DateTimeUtils::getMicroTime();
|
||||||
$beginTime = $endTime - 10000;
|
$beginTime = $endTime - 5000;
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime, 'increment');
|
BusinessFactory::init()->make($shop->plat_id)->setShop($shop)->downloadOrdersAndSave($beginTime, $endTime, 'increment');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class UpdateBusinessGoodsStock implements ShouldQueue
|
|||||||
$log->target_id = $event->goodsSku->id ?? 0;
|
$log->target_id = $event->goodsSku->id ?? 0;
|
||||||
$log->target_field = 'stock';
|
$log->target_field = 'stock';
|
||||||
$log->user_id = 999;
|
$log->user_id = 999;
|
||||||
$log->message = ($event->businessOrderItem['external_sku_id'] ?? $event->businessOrderItem['id']) . '未找到';
|
$log->message = '未找到' . json_encode($event->businessOrderItem, 256);
|
||||||
$log->save();
|
$log->save();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class Goods
|
|||||||
$type = 'pdd.ktt.goods.incr.quantity';
|
$type = 'pdd.ktt.goods.incr.quantity';
|
||||||
$appendParams = [
|
$appendParams = [
|
||||||
'goods_id' => $goodsId,
|
'goods_id' => $goodsId,
|
||||||
'quantity_delta' => $quantity,
|
'quantity_delta' => max($quantity, 0),
|
||||||
'sku_id' => $skuId,
|
'sku_id' => $skuId,
|
||||||
// 非必填
|
// 非必填
|
||||||
'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改
|
'modify_quantity_type' => $modifyType, // 修改库存的类型,不传或1代表增量修改,2代表全量修改
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user