feat(process/Task.php): 移除了更新库存和销量的代码块
This commit is contained in:
parent
8939b40586
commit
80aedd5c13
@ -30,25 +30,6 @@ class Task
|
||||
StoreOrder::where('id', 'in', $oid)->update(['delete_time' => time()]);
|
||||
StoreOrderCartInfo::where('oid','in',$oid)->update(['status'=>OrderEnum::REFUND_STATUS_FINISH]);
|
||||
|
||||
$arr = StoreOrderCartInfo::where('oid', 'in', $oid)->field('store_id,product_id,cart_num')->select();
|
||||
$updateData = [];
|
||||
$updateDataTwo = [];
|
||||
foreach ($arr as $v) {
|
||||
$id=StoreBranchProduct::where('product_id',$v['product_id'])->where('store_id',$v['store_id'])->value('id');
|
||||
if($id){
|
||||
$updateData[] = [
|
||||
'id' => $id,
|
||||
'sales' => ['dec', $v['cart_num']],
|
||||
'stock' => ['inc', $v['cart_num']],
|
||||
];
|
||||
}
|
||||
$updateDataTwo[] = [
|
||||
'id' => $v['product_id'],
|
||||
'sales' => ['dec', $v['cart_num']]
|
||||
];
|
||||
}
|
||||
(new StoreBranchProduct())->saveAll($updateData);
|
||||
(new StoreProduct())->saveAll($updateDataTwo);
|
||||
}
|
||||
|
||||
// 获取当前时间
|
||||
|
Loading…
x
Reference in New Issue
Block a user