panlumeng vor 3 Jahren
Ursprung
Commit
dc00ef81dd
1 geänderte Dateien mit 13 neuen und 2 gelöschten Zeilen
  1. 13 2
      application/Home/controller/Order.php

+ 13 - 2
application/Home/controller/Order.php

@@ -171,10 +171,21 @@ class Order extends Base
                            "before_stock"=>$stock['stock_balance'],
                            "action_uid"=>$this->userinfo['id'],
                            "action_name"=>$this->userinfo['nickname'],
-                           "addtime"=>date("Y-m-d H:i:s")
+                           "addtime"=>date("Y-m-d H:i:s"),
+
                        ];
                        $stocklog =Db::name("stock_log")->insert($log);
-                       if($stocklog){
+                       $log=[
+                           "accountid"=>$this->userinfo['id'],
+                           "addtime"=>date("Y-m-d H:i:s"),
+                            "unit"=>$kg['name'],
+                           "unit_weight"=>$kg['weight'],
+                           "num"=>$num,
+                           "total_weight"=>$num*$kg['weight'],
+                           "unit_id"=>$kg['id']
+                       ];
+                       $st =Db::name("order_log")->insert($log);
+                       if($stocklog && $st){
                            Db::commit();
                            return app_show(0,"下单成功",['orderid'=>$ordercreate]);
                        }