Browse Source

细节优化,两个列表接口商品类型字段优化

wufeng 2 years ago
parent
commit
c140847400

+ 2 - 2
app/abutment/controller/Order.php

@@ -512,7 +512,7 @@ class Order extends HomeBaseController
         $cgdinfo = Db::name("purchease_order")
             ->whereIn('cgdNo', $param['cgdNo'])
             ->where(['is_del' => 0, 'supplierNo' => $this->request->user['supplierNo']])
-            ->where('status', '=', 1)
+            ->where('status', 'in', [1, 2])//1待入库,2部分入库
             ->column('id,wsm_code,good_num,good_price,spuCode,order_type,send_status,status,supplierNo', 'cgdNo');
 
         if (empty($cgdinfo)) return json_show(1005, "未找到采购单数据或采购单未发货");
@@ -660,7 +660,7 @@ class Order extends HomeBaseController
 
                             if ($upcgd == false) throw new Exception('采购单数量更新失败');
                         }
-                        if ($cgdinfo[$cgdNo]['send_status'] == 1 && $cgdinfo[$cgdNo]['order_type'] != 1) {
+                        if (in_array($cgdinfo[$cgdNo]['send_status'], [1, 2]) && $cgdinfo[$cgdNo]['order_type'] != 1) {
                             $send = Db::name("order_send")->where(["cgdNo" => $cgdNo, "status" => 1])->column("outCode");
                             if (!empty($send)) {
                                 $out = Db::name("order_out")->where(["outCode" => $send, "status" => 0])->select()->toArray();

+ 13 - 8
app/admin/controller/Purch.php

@@ -1033,13 +1033,18 @@ class Purch extends Base
 
         $order_source = $order_source = isset($this->post['order_source']) && $this->post['order_source'] != "" ? intval($this->post['order_source']) : "";
         if ($order_source !== "")   $where[] = ['c.order_source', "=", $order_source];
-        $is_stock = $order_source = isset($this->post['is_stock']) && $this->post['is_stock'] != "" ? intval($this->post['is_stock']) : "";
-        if ($is_stock !== "") $where[] = ['b.is_stock', "=", $is_stock];
 
+        $order_type = $order_source = isset($this->post['order_type']) && $this->post['order_type'] != "" ? intval($this->post['order_type']) : "";
+        if ($order_type !== "") $where[] = ['c.order_type', "=", $order_type];
 
 //        $role = $this->checkDataShare();
 //        if (!empty($role[DataGroupModel::$type_全部])) $where[] = ['a.apply_id', 'in', $role[DataGroupModel::$type_全部]];
-       $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo']!="" ? trim($this->post['relaComNo']):"";
+        $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo'] != "" ? trim($this->post['relaComNo']) : "";
+        if ($relaComNo != '') $where[] = ['b.companyNo', '=', $relaComNo];
+
+        $supplierNo = isset($this->post['supplierNo']) && $this->post['supplierNo'] != "" ? trim($this->post['supplierNo']) : "";
+        if ($supplierNo != '') $where[] = ['b.supplierNo', '=', $supplierNo];
+
         if ($this->level == 2) {
             $role = $this->checkDataShare();
             $hand = resign_hand_user($this->uid, 0);
@@ -1047,11 +1052,11 @@ class Purch extends Base
                 $arr = array_unique(array_merge($hand, $role[DataGroupModel::$type_全部]));
                 $where[] = ['a.apply_id', 'in', $arr];
             }
-             if($relaComNo!='') $where[]=['b.companyNo','=', $relaComNo];
+//             if($relaComNo!='') $where[]=['b.companyNo','=', $relaComNo];
         }
-		if($this->level==3){
-			 if($relaComNo!='') $where[]=['b.supplierNo','=', $relaComNo];
-		}
+//		if($this->level==3){
+//			 if($relaComNo!='') $where[]=['b.supplierNo','=', $relaComNo];
+//		}
 
         $count = Db::name('purchease_diff')
             ->alias('a')
@@ -1068,7 +1073,7 @@ class Purch extends Base
             ->where($where)
             ->page($page,$size)
             ->order("a.addtime desc")
-            ->field("a.*,b.cat_id,c.order_source,b.is_stock")
+            ->field("a.*,b.cat_id,c.order_source,c.order_type")
             ->select()
             ->toArray();
 

+ 2 - 2
app/admin/controller/Purchin.php

@@ -1453,8 +1453,8 @@ class Purchin extends Base
 
         $order_source = isset($this->post['order_source']) && $this->post['order_source'] != "" ? intval($this->post['order_source']) : "";
         if ($order_source != '') $where[] = ['b.order_source', '=', $order_source];
-        $is_stock = isset($this->post['is_stock']) && $this->post['is_stock'] != "" ? intval($this->post['is_stock']) : "";
-        if ($is_stock != '') $where[] = ['c.is_stock', '=', $is_stock];
+        $order_type = isset($this->post['order_type']) && $this->post['order_type'] != "" ? intval($this->post['order_type']) : "";
+        if ($order_type !== '') $where[] = ['b.order_type', '=', $order_type];
 
 //        $role = $this->checkDataShare();
 //        if (!empty($role[DataGroupModel::$type_全部])) $where[] = ["a.apply_id", "in", $role[DataGroupModel::$type_全部]];