Ver Fonte

校验供应商是否开通账号优化

wufeng há 2 anos atrás
pai
commit
12435b3651
1 ficheiros alterados com 5 adições e 4 exclusões
  1. 5 4
      app/controller/UserInfo.php

+ 5 - 4
app/controller/UserInfo.php

@@ -772,10 +772,11 @@ class UserInfo extends BaseController
         $supplierNos = $this->request->post('supplierNo', '', 'trim');
 
         $list = Db::name('account_company')
-            ->where(['companyCode' => $supplierNos, 'is_del' => 0, 'status' => 1])
-            ->whereLike('companyCode', 'QS%')
-            ->group('companyCode')
-            ->column('count(id)', 'companyCode');
+            ->alias('a')
+            ->leftJoin('account b', 'b.id=a.account_id')
+            ->where(['a.companyCode' => $supplierNos, 'a.is_del' => 0, 'a.status' => 1, 'b.level' => 3])
+            ->whereLike('a.companyCode', 'QS%')
+            ->column('a.account_id', 'a.companyCode');
 
         return json_show(0, '获取供应商账号开通情况成功', $list);