Ver código fonte

Merge branch 'dev' of wugg/useraccount into master

wugg 1 ano atrás
pai
commit
9833220eab
2 arquivos alterados com 6 adições e 22 exclusões
  1. 5 1
      app/controller/Headquarters.php
  2. 1 21
      app/controller/UserInfo.php

+ 5 - 1
app/controller/Headquarters.php

@@ -462,7 +462,7 @@ class Headquarters extends BaseController
         try {
 
             $info = Db::name('business')
-                ->field('id,companyNo')
+                ->field('id,companyNo,company,contactor,inv_code,license_img')
                 ->where(['id' => $param['id'], 'is_del' => 0])
                 ->findOrEmpty();
             if (empty($info)) throw new Exception('未找到数据');
@@ -552,6 +552,10 @@ class Headquarters extends BaseController
 
         foreach ($list as &$value) {
             $value['company_name'] = '';
+            $value['has_account'] = (AccountCompany::alias("a")
+             ->leftJoin('account b', 'b.id=a.account_id')
+             ->where([ ['a.is_del', '=', 0], ['a.status', '=', 1],['b.level', '=', 3], ['a.companyCode', '=', $value['code']]])
+             ->findOrEmpty()->isEmpty())==False;
         }
         return json_show("0", "获取成功", ['list' => $list, 'count' => $count]);
     }

+ 1 - 21
app/controller/UserInfo.php

@@ -58,15 +58,6 @@ class UserInfo extends BaseController
             ->alias("a")
             ->leftJoin("user b", "a.id=b.account_id and b.status=1")
             ->append(['plat', 'company_relaton'])
-//            ->withAttr('plat', function ($val, $da) {
-//                return Db::name("account_plat")
-//                    ->alias("a")
-//                    ->leftJoin("platform b", "a.plat_code=b.plat_code and b.is_del=0 and b.status=1")
-//                    ->where(["a.status" => 1, "a.is_del" => 0, "a.account_id" => $da['id']])
-//                    ->field("a.plat_code,plat_name")
-//                    ->select()
-//                    ->toArray();
-//            })
             ->withAttr('company_relaton', function ($val, $da) {
                 return Db::name("account_company")
                     ->where(["account_id" => $da['id'], "is_del" => 0])
@@ -336,11 +327,9 @@ class UserInfo extends BaseController
         $count = Db::name("account")
             ->alias("a")
             ->leftJoin("user b", "a.id=b.account_id and b.status=1")
-            ->leftJoin("account_company c", "a.id=c.account_id and c.status=1 and c.is_del=0")
+            ->leftJoin("account_company c", "a.id=c.account_id  and c.is_del=0")
             ->where($condition)
-//            ->whereOr($whereor)
             ->count();
-
         $total = intval(ceil($count / $size));
         $page = $total >= $page ? $page : $total;
         $list = Db::name("account")
@@ -352,15 +341,6 @@ class UserInfo extends BaseController
 //            ->whereOr($whereor)
             ->page($page, $size)
             ->append(['plat', 'company_relaton'])
-//            ->withAttr('plat', function ($val, $da) {
-//                return Db::name("account_plat")
-//                    ->alias("a")
-//                    ->leftJoin("platform b", "a.plat_code=b.plat_code and b.is_del=0 and b.status=1")
-//                    ->where(["a.status" => 1, "a.is_del" => 0, "a.account_id" => $da['id']])
-//                    ->field("a.plat_code,plat_name")
-//                    ->select()
-//                    ->toArray();
-//            })
             ->withAttr('company_relaton', function ($val, $da) {
                 return Db::name("account_company")
                     ->where(["account_id" => $da['id'], "is_del" => 0])