Browse Source

Merge branch 'master-new-wgg' of wugg/phpstock into master-new

wugg 2 years ago
parent
commit
f70d8d81b1
1 changed files with 15 additions and 13 deletions
  1. 15 13
      app/admin/controller/SupplierClient.php

+ 15 - 13
app/admin/controller/SupplierClient.php

@@ -422,6 +422,8 @@ class SupplierClient extends Base {
 
         $supplierNo = isset($this->post['supplierNo']) && $this->post['supplierNo'] != "" ? trim($this->post['supplierNo']) : "";
         if ($supplierNo != '') $where[] = ['b.supplierNo', '=', $supplierNo];
+        $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] != "" ? trim($this->post['companyNo']) : "";
+        if ($companyNo != '') $where[] = ['b.companyNo', '=', $companyNo];
 
         $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];
@@ -630,10 +632,10 @@ class SupplierClient extends Base {
         if ($supplierNo != '') {
             //sale b 表里存的supplierNo值是GS开头的,即业务公司编码
             //所以此处应该根据供应商编码筛选商品spuCode,然后筛选发货单
-            $spuCode = Db::name('good_basic')
-                ->where(['is_del' => 0, 'supplierNo' => $supplierNo])
-                ->column('spuCode');
-            $where[] = ['b.good_code', 'in', $spuCode];
+//            $spuCode = Db::name('good_basic')
+//                ->where(['is_del' => 0, 'supplierNo' => $supplierNo])
+//                ->column('spuCode');
+            $where[] = ['b.supNo', 'like', "%$supplierNo%"];
         }
 
         $cgdNo = isset($this->post['cgdNo']) && $this->post['cgdNo'] !== "" ? $this->post['cgdNo'] : "";
@@ -787,14 +789,14 @@ class SupplierClient extends Base {
         if ($param['orderCode'] != "") $where[] = ['a.orderCode', "like", "%{$param['orderCode']}%"];
         if ($param['good_code'] != "") $where[] = ['a.good_code', "like", "%{$param['good_code']}%"];
         if ($param['good_name'] != "") $where[] = ['a.good_name', "like", "%{$param['good_name']}%"];
-        if ($param['customer_code'] != "") $where[] = ['a.customer_code', "like", "%{$param['customer_code']}%"];
+        if ($param['customer_code'] != "") $where[] = ['c.customer_code', "like", "%{$param['customer_code']}%"];
         if ($param['except_code'] != "") $where[] = ['a.except_code', "=", $param['except_code']];
         if ($param['apply_name'] != "") $where[] = ['a.apply_name', "like", "%{$param['apply_name']}%"];
         if ($param['start'] !== "") $where[] = ['a.addtime', ">=", $param['start']];
         if ($param['end'] !== "") $where[] = ['a.addtime', "<=", $param['end']];
         if ($param['order_source'] !== "") $where[] = ['c.order_source', "=", $param['order_source']];
-        if ($param['supplierNo'] !== "") $where[] = ['a.supplierNo', "like", '%' . $param['supplierNo'] . '%'];
-        if ($param['companyNo'] !== "") $where[] = ['a.companyNo', "like", '%' . $param['companyNo'] . '%'];
+        if ($param['supplierNo'] !== "") $where[] = ['c.supNo', "like", '%' . $param['supplierNo'] . '%'];
+        if ($param['companyNo'] !== "") $where[] = ['c.supplierNo', "like", '%' . $param['companyNo'] . '%'];
 
 
         $condition = [];
@@ -882,7 +884,7 @@ class SupplierClient extends Base {
         }
         $customer_code = isset($this->post['customer_code']) && $this->post['customer_code'] != "" ? trim($this->post['customer_code']) : "";
         if ($customer_code != "") {
-            $where[] = ['a.customer_code', "like", "%{$customer_code}%"];
+            $where[] = ['b.customer_code', "like", "%{$customer_code}%"];
         }
 
 
@@ -914,10 +916,10 @@ class SupplierClient extends Base {
         }
 
         $supplierNo = trim($this->post['supplierNo'] ?? '');
-        if ($supplierNo !== '') $where[] = ['a.supplierNo', 'like', '%'.$supplierNo.'%'];
+        if ($supplierNo !== '') $where[] = ['b.supNo', 'like', '%'.$supplierNo.'%'];
 
         $companyNo = trim($this->post['companyNo'] ?? '');
-        if ($companyNo !== '') $where[] = ['a.companyNo', 'like', '%'.$companyNo.'%'];
+        if ($companyNo !== '') $where[] = ['b.supplierNo', 'like', '%'.$companyNo.'%'];
         $relaComNo = isset($this->post['relaComNo']) && $this->post['relaComNo'] != "" ? trim($this->post['relaComNo']) : "";
         $condition = [];
         //只有level2的账号过滤数据权限
@@ -1026,13 +1028,13 @@ class SupplierClient extends Base {
             $where[] = ['b.skuCode', "like", "%{$skuCode}%"];
         }
         $supplierNo = isset($this->post['supplierNo']) && $this->post['supplierNo'] != "" ? trim($this->post['supplierNo']) : "";
-        if ($supplierNo !== "") $where[] = ['sr.supplierNo', "like", '%' . $supplierNo . '%'];
+        if ($supplierNo !== "") $where[] = ['b.supNo', "like", '%' . $supplierNo . '%'];
 
         $companyNo = isset($this->post['companyNo']) && $this->post['companyNo'] != "" ? trim($this->post['companyNo']) : "";
-        if ($companyNo !== "") $where[] = ['sr.companyNo', "like", '%' . $companyNo . '%'];
+        if ($companyNo !== "") $where[] = ['b.supplierNo', "like", '%' . $companyNo . '%'];
 
         $customer_code = isset($this->post['customer_code']) && $this->post['customer_code'] != "" ? trim($this->post['customer_code']) : "";
-        if ($customer_code !== "") $where[] = ['sr.customer_code', "like", '%' . $customer_code . '%'];
+        if ($customer_code !== "") $where[] = ['b.customer_code', "like", '%' . $customer_code . '%'];
 
         $order_source = $order_source = isset($this->post['order_source']) && $this->post['order_source'] != "" ? trim($this->post['order_source']) : "";
         if ($order_source !== "") $where[] = ['b.order_source', "=", $order_source];