作者 刘锟

update

@@ -53,7 +53,7 @@ class SyncInquiryProject extends Command @@ -53,7 +53,7 @@ class SyncInquiryProject extends Command
53 53
54 /** 54 /**
55 * 同步优化项目及路由 55 * 同步优化项目及路由
56 - * TODO 同步v4 v5 v6项目以及路由, 删除过期项目及路由 56 + * 同步v4 v5 v6项目以及路由, 删除过期项目及路由
57 * @return bool 57 * @return bool
58 */ 58 */
59 public function handle() 59 public function handle()
@@ -133,7 +133,6 @@ class SyncInquiryProject extends Command @@ -133,7 +133,6 @@ class SyncInquiryProject extends Command
133 $query->orwhere('gl_project_online_check.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) 133 $query->orwhere('gl_project_online_check.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)
134 ->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); 134 ->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE);
135 }) 135 })
136 - ->limit(5)  
137 ->get(['gl_project.id', 'gl_project.title', 'gl_project.level', 'gl_project.channel']); 136 ->get(['gl_project.id', 'gl_project.title', 'gl_project.level', 'gl_project.channel']);
138 // 获取所有项目域名 137 // 获取所有项目域名
139 $domains = DomainInfo::whereIn('project_id', $project->pluck('id')->toArray())->pluck('domain', 'project_id')->toArray(); 138 $domains = DomainInfo::whereIn('project_id', $project->pluck('id')->toArray())->pluck('domain', 'project_id')->toArray();
@@ -142,7 +141,7 @@ class SyncInquiryProject extends Command @@ -142,7 +141,7 @@ class SyncInquiryProject extends Command
142 // 过滤暂停优化项目, 映射类型2, model没有定义常量 141 // 过滤暂停优化项目, 映射类型2, model没有定义常量
143 if (in_array(2, $val->level)) 142 if (in_array(2, $val->level))
144 continue; 143 continue;
145 - $project = InquiryProject::saveProject($date,InquiryProject::VERSION_SIX, $val->id, $val->title, $val->channel['channel_id'], $domains[$val->id]); 144 + $project = InquiryProject::saveProject($date,InquiryProject::VERSION_SIX, $val->id, $val->title, $val->channel['channel_id'], 'https://'.$domains[$val->id].'/');
146 $this->pushTask($project->id); 145 $this->pushTask($project->id);
147 } 146 }
148 147
@@ -190,4 +189,4 @@ class SyncInquiryProject extends Command @@ -190,4 +189,4 @@ class SyncInquiryProject extends Command
190 file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND); 189 file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND);
191 return true; 190 return true;
192 } 191 }
193 -}  
  192 +}
@@ -53,7 +53,7 @@ class SyncInquiryProjectRoute extends Command @@ -53,7 +53,7 @@ class SyncInquiryProjectRoute extends Command
53 53
54 /** 54 /**
55 * 同步优化项目及路由 55 * 同步优化项目及路由
56 - * TODO 同步v4 v5 v6项目以及路由, 删除过期项目及路由 56 + * 同步v4 v5 v6项目以及路由, 删除过期项目及路由
57 * @return bool 57 * @return bool
58 */ 58 */
59 public function handle() 59 public function handle()
@@ -130,7 +130,7 @@ class SyncInquiryProjectRoute extends Command @@ -130,7 +130,7 @@ class SyncInquiryProjectRoute extends Command
130 echo '同步项目ID:' . $task->id . PHP_EOL; 130 echo '同步项目ID:' . $task->id . PHP_EOL;
131 $date = intval(date('Ymd')); 131 $date = intval(date('Ymd'));
132 ProjectServer::useProject($task->primary_id); 132 ProjectServer::useProject($task->primary_id);
133 - // TODO 产品分类标题、路由, 产品标题、路由, 同步到路由表 133 + // 产品分类标题、路由, 产品标题、路由, 同步到路由表
134 $category = Category::where('status', Category::STATUS_ACTIVE)->get(['title', 'route']); 134 $category = Category::where('status', Category::STATUS_ACTIVE)->get(['title', 'route']);
135 foreach ($category as $key=>$val) { 135 foreach ($category as $key=>$val) {
136 InquiryProjectRoute::saveProjectRoute($task->id, $val->title, $val->route, $date); 136 InquiryProjectRoute::saveProjectRoute($task->id, $val->title, $val->route, $date);
@@ -181,4 +181,4 @@ class SyncInquiryProjectRoute extends Command @@ -181,4 +181,4 @@ class SyncInquiryProjectRoute extends Command
181 file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND); 181 file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND);
182 return true; 182 return true;
183 } 183 }
184 -}  
  184 +}