panlumeng 3 年 前
コミット
9e91e7827c

+ 1 - 1
application/Admin/controller/Stock2.php

@@ -25,7 +25,7 @@ class Stock2 extends Base
         if ($status != "") {
             $where ['status'] = $status;
         }
-        $video_sn = isset($this->post['video_sn']) && $this->post['video_sn'] !== "" ? intval($this->post['video_sn']) : "";
+        $video_sn = isset($this->post['video_sn']) && $this->post['video_sn'] !== "" ? trim($this->post['video_sn']) : "";
         if ($video_sn !== "") {
             $where['video_sn'] = ["like", "%{$video_sn}%"];
         }

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

@@ -63,14 +63,15 @@ class Order extends Base
             return error_show(1004,"参数num 不能为空或0");
         }
         $id = isset($this->post['unit_id'])&&$this->post['unit_id']!=""? intval($this->post['unit_id']): "";
-        if($id){
+        if($id==""){
             return error_show(1004,"unit_id不能为空");
         }
+
         $kg= Db::name('unit')->where(["is_del" => 0,"id"=>$id,"status"=>1])->field("id,name,weight")->find();
+       // var_dump(Db::name('unit')->where(["is_del" => 0,"id"=>$id,"status"=>1])->getLastSql());
         if(empty($kg)){
             return error_show(1004,"单位不能为空");
         }
-
         $count=$num*$kg['weight'];
         if($count==""){
             return error_show(1004,"购买数量不能为空");
@@ -95,6 +96,8 @@ class Order extends Base
                 "order_sn"=>$ordersn,
                 "accountid"=>$this->userinfo['id'],
                 "order_num"=>$num,
+                "unit"=>$kg['name'],
+                "unit_weight"=>$kg['weight'],
                 "is_del"=>0,
                 "status"=>1,
                 "addtime"=>date("Y-m-d H:i:s"),

+ 1 - 1
application/route.php

@@ -71,7 +71,7 @@ Route::rule("home/addredit","Home/Addr/Edit");
 Route::rule("home/addrdel","Home/Addr/Delete");
 
 Route::rule("home/orderlist","Home/Order/list");
-Route::rule("home/orderist","Home/Order/Ist");
+Route::rule("home/unitist","Home/Order/Ist");
 Route::rule("home/orderinfo","Home/Order/info");
 Route::rule("home/orderadd","Home/Order/add");
 Route::rule("home/orderstock","Home/Order/Stock");