作者 lyh
@@ -40,15 +40,14 @@ class HtmlCollect extends Command @@ -40,15 +40,14 @@ class HtmlCollect extends Command
40 40
41 public function handle() 41 public function handle()
42 { 42 {
43 -// while (true) { 43 + while (true) {
44 $this->start_collect(); 44 $this->start_collect();
45 -// } 45 + }
46 } 46 }
47 47
48 protected function start_collect() 48 protected function start_collect()
49 { 49 {
50 -// $task_id = $this->get_task();  
51 - $task_id = '543_1'; 50 + $task_id = $this->get_task();
52 if ($task_id === false) { 51 if ($task_id === false) {
53 //所有项目采集完成 52 //所有项目采集完成
54 sleep(60); 53 sleep(60);
@@ -296,7 +296,7 @@ class ProjectUpdate extends Command @@ -296,7 +296,7 @@ class ProjectUpdate extends Command
296 $id = $model->insertGetId([ 296 $id = $model->insertGetId([
297 'project_id' => $project_id, 297 'project_id' => $project_id,
298 'title' => $item['ttile'], 298 'title' => $item['ttile'],
299 - 'intro' => $item['description'] ?? '', 299 + 'intro' => $item['short_description'] ?? '',
300 'content' => $item['content'] ?? '', 300 'content' => $item['content'] ?? '',
301 'category_id' => $category_id, 301 'category_id' => $category_id,
302 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', 302 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
@@ -462,6 +462,9 @@ class ProjectUpdate extends Command @@ -462,6 +462,9 @@ class ProjectUpdate extends Command
462 DB::disconnect('custom_mysql'); 462 DB::disconnect('custom_mysql');
463 463
464 $task->status = UpdateLog::STATUS_COM;//同步完成 464 $task->status = UpdateLog::STATUS_COM;//同步完成
  465 + if($api_type == 'post' || $api_type == 'page' || $api_type == 'news' || $api_type == 'blog'){
  466 + $task->collect_status = UpdateLog::COLLECT_STATUS_UN;
  467 + }
465 $task->save(); 468 $task->save();
466 469
467 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', task_type: ' . $api_type . ', update end ' . PHP_EOL; 470 echo 'date:' . date('Y-m-d H:i:s') . ', task_id: ' . $task->id . ', task_type: ' . $api_type . ', update end ' . PHP_EOL;