From 7413d760dcb9bd0c10f7570de300e2122467be01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=82=E7=8F=82?= Date: Sat, 7 Dec 2024 16:46:46 +0800 Subject: [PATCH] dev --- .../src/Commands/AliPromotepageCommand.php | 4 ++-- packages/bydauto/src/Commands/BYDAutoCommand.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/bydauto/src/Commands/AliPromotepageCommand.php b/packages/bydauto/src/Commands/AliPromotepageCommand.php index 40312fe..32a1afc 100644 --- a/packages/bydauto/src/Commands/AliPromotepageCommand.php +++ b/packages/bydauto/src/Commands/AliPromotepageCommand.php @@ -47,8 +47,8 @@ public function download($promote_page_id) $bizParams['page_no'] = 1; $bizParams['page_size'] = 1000; $bizParams['promote_page_id'] = $promote_page_id; - // $bizParams['start_date'] = Carbon::now()->subDays(2)->format('Y-m-d'); - $bizParams['start_date'] = '2024-11-14'; + $bizParams['start_date'] = Carbon::now()->subDays(2)->format('Y-m-d'); + // $bizParams['start_date'] = '2024-11-14'; $bizParams['end_date'] = Carbon::now()->format('Y-m-d'); $message = sprintf('===== 开始同步推广页留资数据:[页面ID] %s [开始日期] %s [结束日期] %s', $promote_page_id, $bizParams['start_date'], $bizParams['end_date']); diff --git a/packages/bydauto/src/Commands/BYDAutoCommand.php b/packages/bydauto/src/Commands/BYDAutoCommand.php index 0f9c068..f59cfeb 100644 --- a/packages/bydauto/src/Commands/BYDAutoCommand.php +++ b/packages/bydauto/src/Commands/BYDAutoCommand.php @@ -27,6 +27,22 @@ public function handle() } } + public function action_data_fix() + { + $source = ['alipromote:108600010', 'alipromote:108600017']; + $items = Testdrive::query()->whereIn('source', $source)->get(); + foreach($items as $item) { + $propertyList = $item->rawdata['property_list']; + $name = collect($propertyList)->firstWhere('key', '姓名'); + $item->name = $name['value'] ?? ''; + $mobile = collect($propertyList)->firstWhere('key', '手机号'); + $item->mobile = $mobile['value'] ?? ''; + $item->save(); + } + $this->info('Data fix done'); + return Command::SUCCESS; + } + public function action_mail_test() { $users = Contact::query()->get();