From 08bc555160fa9ebe2fdfbba975576fbb64ff74b7 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 27 Oct 2021 21:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=AF=E5=8C=BA=E6=94=B9=E4=B8=BA=E6=97=85?= =?UTF-8?q?=E6=B8=B8=E7=BA=BF=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Collector.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/Collector.php b/app/Console/Commands/Collector.php index dec9bc7..f696061 100644 --- a/app/Console/Commands/Collector.php +++ b/app/Console/Commands/Collector.php @@ -53,7 +53,7 @@ class Collector extends Command $this->line("供应商 $supplier_id 导入完毕"); } else { // $this->exists_update = false; - $this->scenic(); + $this->tourist_line(); $this->hotel(); $this->line('全部采集完毕'); } @@ -195,8 +195,8 @@ class Collector extends Command return substr(md5(json_encode($params) . 'c9d6618dbc657b41a66eb0af952906f1'), 2, 10); } - //景区采集 - private function scenic() + //旅游线路采集 + private function tourist_line() { $http = Http::withOptions(['verify' => false]); @@ -251,14 +251,14 @@ class Collector extends Command $extends = []; if (isset($info['data']['list']['base']['tags']) && is_array($info['data']['list']['base']['tags'])) { foreach ($info['data']['list']['base']['tags'] as $tag) { - $extends['field_2_project'][] = ['name' => $tag, 'num' => '', 'price' => '']; + $extends['field_0_project'][] = ['name' => $tag, 'num' => '', 'price' => '']; } } CollectProduct::updateOrCreate(['unique_id' => $id, 'site' => 1], [ 'unique_id' => $id, 'site' => 1, - 'type' => 2, //0:旅游线路、1:酒店、2:景区、3:餐厅、4:车队、5:单项 + 'type' => 0, //0:旅游线路、1:酒店、2:景区、3:餐厅、4:车队、5:单项 'title' => mb_substr($info['data']['list']['base']['title'] ?? '', 0, 255), 'price' => $info['data']['list']['base']['price_zhanshi'] ?? 0, 'original_price' => ($info['data']['list']['base']['price_zhanshi'] ?? 0) * 1.58,