作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

@@ -102,7 +102,7 @@ class DomainInfo extends Command @@ -102,7 +102,7 @@ class DomainInfo extends Command
102 $v->save(); 102 $v->save();
103 103
104 //域名到期提醒 104 //域名到期提醒
105 - if ($valid_time['end'] < $end_day) { 105 + if ($v['is_expire_remind'] && $valid_time['end'] < $end_day) {
106 $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0; 106 $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
107 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 107 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
108 } 108 }
@@ -143,7 +143,7 @@ class DomainInfo extends Command @@ -143,7 +143,7 @@ class DomainInfo extends Command
143 $v->save(); 143 $v->save();
144 144
145 //域名到期提醒 145 //域名到期提醒
146 - if ($valid_time['end'] < $end_day) { 146 + if ($v['is_expire_remind'] && $valid_time['end'] < $end_day) {
147 $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0; 147 $is_end = $valid_time['end'] < date('Y-m-d H:i:s') ? 1 : 0;
148 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end); 148 $this->domainChatMessage($v['project_id'], $v['id'], $v['domain'], $is_end);
149 } 149 }
@@ -12,6 +12,7 @@ use App\Http\Logic\Bside\User\UserLoginLogic; @@ -12,6 +12,7 @@ use App\Http\Logic\Bside\User\UserLoginLogic;
12 use App\Models\Ai\AiBlog; 12 use App\Models\Ai\AiBlog;
13 use App\Models\Blog\Blog; 13 use App\Models\Blog\Blog;
14 use App\Models\Domain\DomainInfo; 14 use App\Models\Domain\DomainInfo;
  15 +use App\Models\Industry\ProjectIndustryRelated;
15 use App\Models\Inquiry\InquiryRelateDomain; 16 use App\Models\Inquiry\InquiryRelateDomain;
16 use App\Models\Manage\ManageHr; 17 use App\Models\Manage\ManageHr;
17 use App\Models\News\News; 18 use App\Models\News\News;
@@ -47,12 +48,12 @@ class PrivateController extends BaseController @@ -47,12 +48,12 @@ class PrivateController extends BaseController
47 public function optimizeProjectList(Request $request) 48 public function optimizeProjectList(Request $request)
48 { 49 {
49 $page_size = $request->input('page_size', 20); 50 $page_size = $request->input('page_size', 20);
50 - $field = ['gl_project.id', 'gl_project.company', 'gl_project.is_upgrade', 'b.start_date', 'd.domain', 'b.special', 'f.industry_name']; 51 + $field = ['gl_project.id', 'gl_project.company', 'gl_project.is_upgrade', 'b.start_date', 'd.domain', 'b.special', 'gl_project.from_order_id'];// 'f.industry_name',
51 $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id') 52 $result = Project::select($field)->leftJoin('gl_project_deploy_optimize as b', 'gl_project.id', '=', 'b.project_id')
52 ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') 53 ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id')
53 ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') 54 ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id')
54 - ->leftJoin('gl_project_industry_related as e', 'gl_project.id', '=', 'e.project_id')  
55 - ->leftJoin('gl_project_industry as f', 'e.industry_id', '=', 'f.id') 55 +// ->leftJoin('gl_project_industry_related as e', 'gl_project.id', '=', 'e.project_id')
  56 +// ->leftJoin('gl_project_industry as f', 'e.industry_id', '=', 'f.id')
56 ->where('gl_project.type', Project::TYPE_TWO) 57 ->where('gl_project.type', Project::TYPE_TWO)
57 ->where('gl_project.project_type',Project::TYPE_ZERO) 58 ->where('gl_project.project_type',Project::TYPE_ZERO)
58 ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 59 ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制
@@ -62,6 +63,14 @@ class PrivateController extends BaseController @@ -62,6 +63,14 @@ class PrivateController extends BaseController
62 }) 63 })
63 ->paginate($page_size) 64 ->paginate($page_size)
64 ->toArray(); 65 ->toArray();
  66 +
  67 + // 直接关联查询, 会出现数据错误
  68 + $project_ids = array_column($result['list'], 'id');
  69 + $industry = ProjectIndustryRelated::leftJoin('gl_project_industry', 'gl_project_industry_related.industry_id', '=', 'gl_project_industry.id')->whereIn('project_id', $project_ids)->pluck('industry_name', 'project_id')->toArray();
  70 + foreach ($result['list'] as &$val) {
  71 + $val['industry_name'] = FALSE == empty($industry[$val['id']]) ? $industry[$val['id']] : '';
  72 + }
  73 +
65 return $this->success($result); 74 return $this->success($result);
66 } 75 }
67 76