wufeng 2 years ago
parent
commit
6e1a80e387
2 changed files with 30 additions and 0 deletions
  1. 29 0
      app/admin/controller/Supplier.php
  2. 1 0
      app/admin/route/app.php

+ 29 - 0
app/admin/controller/Supplier.php

@@ -206,4 +206,33 @@ public function selec(){
         return error_show(1002,"供应商信息删除失败");
     }
 }
+
+
+    //供应商和业务企业合并列表
+    public function comprehensiveList()
+    {
+        $post = $this->request->only(['companyNo' => '', 'name' => '', 'type' => '', 'page' => 1, 'size' => 10], 'post', 'trim');
+        $condition = [];
+        if ($post['companyNo'] != '') $condition [] = ['code', '=', $post['companyNo']];
+        if ($post['name'] != '') $condition [] = ['name|a.contector', 'like', '%' . $post['name'] . '%'];
+        if ($post['type'] != '') $condition [] = ['type', '=', $post['type']];
+
+        $count = Db::name('supplier_info')
+            ->alias('a')
+            ->leftJoin('company_info b', 'a.code=b.companyNo and b.is_del=0')
+            ->where($condition)
+            ->count('a.id');
+
+        $list = Db::name('supplier_info')
+            ->alias('a')
+            ->leftJoin('company_info b', 'a.code=b.companyNo and b.is_del=0')
+            ->field('a.*,b.company_name,company_address,company_license,bankNo,bank_name,b.contector as company_contector,b.mobile as company_mobile,company_img')
+            ->where($condition)
+            ->page($post['page'], $post['size'])
+            ->order('a.id desc')
+            ->select()
+            ->toArray();
+        return json_show(0, '获取成功', ['count' => $count, 'list' => $list]);
+    }
+
 }

+ 1 - 0
app/admin/route/app.php

@@ -70,6 +70,7 @@ Route::rule('suppliercreate', 'admin/Supplier/create');
 Route::rule('supplieredit', 'admin/Supplier/edit');
 Route::rule('supplierselec', 'admin/Supplier/selec');
 Route::rule('supplierdelect', 'admin/Supplier/del');
+Route::rule('supplierdelect', 'admin/Supplier/comprehensiveList');
 
 Route::rule('resultlist', 'admin/Result/list');
 Route::rule('resultcreate', 'admin/Result/create');