wupengfei 2 years ago
parent
commit
6e27f83013
2 changed files with 8 additions and 5 deletions
  1. 2 3
      .idea/workspace.xml
  2. 6 2
      application/operate/controller/SupplierGoods.php

+ 2 - 3
.idea/workspace.xml

@@ -2,9 +2,8 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <change afterPath="$PROJECT_DIR$/application/common/model/Company.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/common/model/Supplier.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common/model/Supplier.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -290,7 +289,7 @@
       <workItem from="1681174490906" duration="23334000" />
       <workItem from="1681260946292" duration="27381000" />
       <workItem from="1681348081818" duration="22448000" />
-      <workItem from="1681434523223" duration="2406000" />
+      <workItem from="1681434523223" duration="2769000" />
     </task>
     <servers />
   </component>

+ 6 - 2
application/operate/controller/SupplierGoods.php

@@ -32,9 +32,13 @@ class SupplierGoods extends Controller
     {
         $this->title = '供货商商品列表';
         $supplier_id = input('get.id');
+        $company_id = input('get.company_id');
         $this->supplier_id = $supplier_id;
-        $query = $this->_query($this->table)->where('is_deleted',0)->where('supplier_id',$supplier_id);
-        $query->like('name');
+        $where = [];
+        $where[] = ['is_deleted','=',0];
+        if($supplier_id)$where[] = ['supplier_id','=',$supplier_id];
+        if($company_id)$where[] = ['company_id','=',$company_id];
+        $query = $this->_query($this->table)->where($where)->like('name');
         $query->order(' sort desc , id desc')->page();
     }