From 9b4e02ed765c8b9499cf82bf8594f1c3d8e51b3c Mon Sep 17 00:00:00 2001 From: jianghanbo Date: Tue, 20 Aug 2024 09:26:37 +0800 Subject: [PATCH] log --- service/app/command/SpiderDy.php | 4 ++++ service/app/server/Douyin.php | 15 ++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/service/app/command/SpiderDy.php b/service/app/command/SpiderDy.php index 6deed990..34f1c6c6 100644 --- a/service/app/command/SpiderDy.php +++ b/service/app/command/SpiderDy.php @@ -400,6 +400,10 @@ class SpiderDy extends Command } } + // 数据小于50, 结束 + if (count($list) < 50) { + break; + } $page++; } } diff --git a/service/app/server/Douyin.php b/service/app/server/Douyin.php index de387d5c..9f05127e 100644 --- a/service/app/server/Douyin.php +++ b/service/app/server/Douyin.php @@ -166,10 +166,11 @@ class Douyin echo date('Y-m-d', $start) . '--' . date('Y-m-d', $end) . " 抖音 page:{$page} total_count:" . $list->data->pagination->total_count . " page_count:" . $list->data->pagination->page_count . " \n\n"; foreach ($list->data->list as $order) { - echo "抖音 订单号:{$order->order_id} \n\n"; + Log::info("抖音 订单号:{$order->order_id} \n\n"); $orderDetail = $this->_orderDetail($order->order_id, $order->status); if (empty($orderDetail)) { + Log::info("抖音 订单号拉取失败:{$order->order_id}"); throw new Exception("抖音拉单{$order->order_id}详情获取失败"); } @@ -571,12 +572,12 @@ class Douyin } $body = curl_exec($ch); curl_close($ch); -// if ($this->os == 5) { -// echo "抖音 os:{$this->os} \n\n"; -// echo "抖音 订单url:{$url} \n\n"; -// echo "抖音 订单cookie:{$this->_cookie()} \n\n"; -// echo "抖音 body:{$body} \n\n"; -// } + if ($this->os == 5) { + Log::info("抖音 os:{$this->os} \n\n"); + Log::info( "抖音 订单url:{$url} \n\n"); + Log::info( "抖音 订单cookie:{$this->_cookie()} \n\n"); + Log::info( "抖音 body:{$body} \n\n"); + } if (!in_array($method, ['GET', 'POST'])) { $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($body, 0, $header_size);