From 77e2e4fdb2dd24ad7ccf6417569e7f24a9645f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=82=E7=8F=82?= Date: Fri, 15 Nov 2024 18:16:51 +0800 Subject: [PATCH] init --- packages/bydauto/src/Commands/BYDAutoCommand.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/bydauto/src/Commands/BYDAutoCommand.php b/packages/bydauto/src/Commands/BYDAutoCommand.php index 99e5f7b..37e2477 100644 --- a/packages/bydauto/src/Commands/BYDAutoCommand.php +++ b/packages/bydauto/src/Commands/BYDAutoCommand.php @@ -65,7 +65,7 @@ public function action_push2contact() // 去除中文名字长度大于3的数据 // $items = $items->filter(function ($item) { - // return !$this->filterDirtyName($item->name); + // return !$this->isDirtyName($item->name); // }); // 联系人 @@ -81,7 +81,7 @@ public function action_push2contact() // 分配数据 foreach ($items as $item) { - if (mb_strlen($item->name) >= 6) { + if ($this->isDirtyName($item->name)) { info("试驾数据 {$item->id} 姓名异常 {$item->name}"); $this->info("试驾数据 {$item->id} 姓名异常 {$item->name}"); $item->update(['status' => Testdrive::STATUS_REJECTED]); @@ -94,8 +94,8 @@ public function action_push2contact() } else { $sendList[$contact->id][] = $item; } - info("分配试驾数据 {$item->id} 给联系人 {$contact->id}"); - $this->info("分配试驾数据 {$item->id} 给联系人 {$contact->id}"); + // info("分配试驾数据 {$item->id} 给联系人 {$contact->id}"); + // $this->info("分配试驾数据 {$item->id} 给联系人 {$contact->id}"); Activity::create([ 'name' => '试驾通知', 'content' => ['testdrive' => $item->id, 'contact' => $contact->id], @@ -143,7 +143,7 @@ public function action_contact_add() $this->info('Contact added'); } - protected function filterDirtyName($str, $max = 3) + protected function isDirtyName($str, $max = 3) { if (!preg_match('/^[\x{4e00}-\x{9fa5}]+$/u', $str)) { return false;