wupengfei 2 years ago
parent
commit
ee2beac355

+ 5 - 4
.idea/workspace.xml

@@ -3,7 +3,8 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier_goods/form.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/form.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/controller/SupplierGoods.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/operate/view/supplier_goods/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/application/operate/view/supplier_goods/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -289,7 +290,7 @@
       <workItem from="1681174490906" duration="23334000" />
       <workItem from="1681260946292" duration="27381000" />
       <workItem from="1681348081818" duration="22448000" />
-      <workItem from="1681434523223" duration="18257000" />
+      <workItem from="1681434523223" duration="18442000" />
     </task>
     <servers />
   </component>
@@ -455,10 +456,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="1291" y="317" key="run.anything.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1679553349659" />
-    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup" timestamp="1680939743475">
+    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup" timestamp="1681462146948">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1680939743475" />
+    <state x="1581" y="565" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400@0.0.2560.1400" timestamp="1681462146948" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>

+ 4 - 3
application/operate/controller/SupplierGoods.php

@@ -36,9 +36,10 @@ class SupplierGoods extends Controller
         $this->supplier_id = $supplier_id;
         $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');
+        if($supplier_id)$where[] = ['a.supplier_id','=',$supplier_id];
+        if($company_id)$where[] = ['a.company_id','=',$company_id];
+        $query = $this->_query($this->table)->where($where)->like('a.name')->field('a.*,b.title supplier_name ,c.title company_name');
+        $query->leftJoin('Supplier b','b.id = a.supplier_id')->leftJoin('Company c','c.id = a.company_id');
         $query->order(' sort desc , id desc')->page();
     }
 

+ 4 - 2
application/operate/view/supplier_goods/index.html

@@ -13,7 +13,8 @@
 
             <th class='list-table-sort-td'><button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button></th>
             <th class='text-left nowrap'>名称</th>
-
+            <th class='text-left nowrap'>供应商</th>
+            <th class='text-left nowrap'>公司</th>
             <th class="text-left" style="width: 20%">操作</th>
         </tr>
         </thead>
@@ -22,7 +23,8 @@
         <tr>
             <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
             <td class='text-left nowrap'>{$vo.name|default=''}</td>
-
+            <td class='text-left nowrap'>{$vo.supplier_name|default=''}</td>
+            <td class='text-left nowrap'>{$vo.company_name|default=''}</td>
             <td class='text-left' style="width: 20%">
 
                 <a data-title="编 辑" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}&supplier_id={$vo.supplier_id}&source={$Think.get.source}'>编 辑</a>