Przeglądaj źródła

发货成功改bill

lizhen_gitee 1 tydzień temu
rodzic
commit
99b318b783

+ 1 - 1
addons/shopro/job/OrderPaid.php

@@ -64,7 +64,7 @@ class OrderPaid extends BaseJob
                         Db::name('live_room_log')->where('id',$order['room_log_id'])->update($room_data);
                     }
 
-                    //支付完成冗余到bill
+                    //支付完成,冗余到bill
                     Db::name('bill')->where([
                         'table_name' => 'shopro_order',
                         'table_id' => $order['id'],

+ 3 - 2
addons/shopro/service/order/OrderCreate.php

@@ -1314,7 +1314,7 @@ class OrderCreate
         return $order;
     }
 
-    //冗余到bill表
+    //下单,冗余到bill表
     public function createBill($order_id,$orderData,$bill_args){
 
         $num_sum = array_sum(array_column($bill_args,'goods_num'));
@@ -1336,7 +1336,8 @@ class OrderCreate
             'createtime' => time(),
         ];
 
-        Db::name('bill')->insertGetId($bill);
+        $bill_id = Db::name('bill')->insertGetId($bill);
+        return $bill_id;
     }
 
 

+ 9 - 0
addons/shopro/service/order/OrderDispatch.php

@@ -82,6 +82,15 @@ class OrderDispatch
             $orderItem->ext = array_merge($orderItem->ext, ['send_time' => time()]);    // item 发货时间
             $orderItem->save();
             OrderAction::add($this->order, $orderItem, $admin, 'admin', "商品{$orderItem->goods_title}已发货");
+
+            //发货,冗余到bill表
+            Db::name('bill')->where([
+                'table_name' => 'shopro_order',
+                'table_id' => $this->order->id,
+            ])->update([
+                'status' => 2, //待收货
+            ])
+
         }
         $this->subscribeExpressInfo($orderExpress);
         // 订单发货后