diff --git a/process/Task.php b/process/Task.php index df537e071..2fedfff83 100644 --- a/process/Task.php +++ b/process/Task.php @@ -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); } // 获取当前时间