diff --git a/app/crm/controller/FollowController.php b/app/crm/controller/FollowController.php index caf785f..42d6a01 100644 --- a/app/crm/controller/FollowController.php +++ b/app/crm/controller/FollowController.php @@ -92,9 +92,11 @@ class FollowController extends BaseController if (Util::isEmpty($type)) { return $this->error('type' . trans('not_null')); } + $audio_text = Util::getParam($request, 'audio_text', ''); $picture = Util::getParam($request, 'picture'); - if (Util::isEmpty($picture)) { - return $this->error(trans('picture_not_null')); + $remark = Util::getParam($request,'remark'); + if(Util::isEmpty($picture) && Util::isEmpty($audio_text) && Util::isEmpty($remark)){ + return $this->error(trans('follow_not_null')); } $corpInfo = Corp::where('abbr', $request->basic_data['corp_abbr'])->first(); @@ -107,7 +109,7 @@ class FollowController extends BaseController 'picture' => $picture, 'remark' => Util::getParam($request, 'remark', ''), 'audio' => Util::getParam($request, 'audio', ''), - 'audio_text' => Util::getParam($request, 'audio_text', ''), + 'audio_text' => $audio_text, 'lat' => Util::getParam($request, 'lat', 0), 'lng' => Util::getParam($request, 'lng', 0), 'address' => Util::getParam($request, 'address'), diff --git a/app/process/Task.php b/app/process/Task.php new file mode 100644 index 0000000..540eb8f --- /dev/null +++ b/app/process/Task.php @@ -0,0 +1,39 @@ +', time()], + ['warn', '<', 1] + ]; + $customer = Customer::where($where)->get(); + foreach ($customer as $item) { + $res =[ + 'id'=>$item->id, + 'category'=>'crm', + 'scene'=>'crm-person-follow-up', + 'receive type'=>'person' + ]; + \Webman\RedisQueue\Redis::send("feishu-message",$res); + } + + Log::info('send follow start',[time()]); + }); + } + +} \ No newline at end of file diff --git a/composer.json b/composer.json index 9847f65..64b3e58 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,8 @@ "shopwwi/filesystem-oss": "^1.0", "webman/redis-queue": "^2.1", "symfony/translation": "^7.3", - "symfony/filesystem": "^7.3" + "symfony/filesystem": "^7.3", + "workerman/crontab": "^1.0" }, "suggest": { "ext-event": "For better performance. " diff --git a/composer.lock b/composer.lock index 3736333..7f84b75 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6c03076d4c7c86514f6b2d0073545bea", + "content-hash": "8ef9d9a07b2be477345002a7623ea951", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -6292,6 +6292,56 @@ }, "time": "2025-02-17T03:34:21+00:00" }, + { + "name": "workerman/crontab", + "version": "v1.0.7", + "source": { + "type": "git", + "url": "https://github.com/walkor/crontab.git", + "reference": "74f51ca8204e8eb628e57bc0e640561d570da2cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/walkor/crontab/zipball/74f51ca8204e8eb628e57bc0e640561d570da2cb", + "reference": "74f51ca8204e8eb628e57bc0e640561d570da2cb", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "workerman/workerman": ">=4.0.20" + }, + "type": "library", + "autoload": { + "psr-4": { + "Workerman\\Crontab\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "walkor", + "email": "walkor@workerman.net", + "homepage": "http://www.workerman.net", + "role": "Developer" + } + ], + "description": "A crontab written in PHP based on workerman", + "homepage": "http://www.workerman.net", + "keywords": [ + "crontab" + ], + "support": { + "email": "walkor@workerman.net", + "forum": "http://wenda.workerman.net/", + "issues": "https://github.com/walkor/workerman/issues", + "source": "https://github.com/walkor/crontab", + "wiki": "http://doc.workerman.net/" + }, + "time": "2025-01-15T07:20:50+00:00" + }, { "name": "workerman/redis", "version": "v2.0.4", diff --git a/config/process.php b/config/process.php index 224a111..05b250f 100644 --- a/config/process.php +++ b/config/process.php @@ -59,5 +59,8 @@ return [ 'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/', ] ] - ] + ], + 'task' => [ + 'handler' => app\process\Task::class + ], ]; diff --git a/resource/translations/ar/messages.php b/resource/translations/ar/messages.php index 7430697..ed99240 100644 --- a/resource/translations/ar/messages.php +++ b/resource/translations/ar/messages.php @@ -23,6 +23,7 @@ return [ 'param_error' => ' خطأ في المعلمات', 'required_not_null' => ' الحقول المطلوبة لا يمكن أن تكون فارغة', 'picture_not_null' => ' لا يمكن أن تكون الصورة فارغة', + 'follow_not_null' => ' الصورة و متابعة المحتوى لا يمكن أن تكون فارغة في نفس الوقت', 'contacts_not_null' => ' لا يمكن أن يكون جهة الاتصال أو البريد الإلكتروني أو الهاتف فارغين جميعًا في نفس الوقت', 'car_type_not_null' => ' لا يمكن أن تكون التفضيلات فارغة', 'channel_not_null' => ' لا يمكن أن تكون القناة فارغة', diff --git a/resource/translations/en/messages.php b/resource/translations/en/messages.php index 342ffad..4c73bcd 100644 --- a/resource/translations/en/messages.php +++ b/resource/translations/en/messages.php @@ -23,6 +23,7 @@ return [ 'param_error' => ' param error', 'required_not_null' => ' required not_ ull', 'picture_not_null' => ' picture not null', + 'follow_not_null' => ' The image and follow-up content cannot be empty at the same time', 'contacts_not_null' => ' Contact person, email, and phone cannot be empty at the same time', 'car_type_not_null' => ' preference_not_null', 'channel_not_null' => ' channel not null', diff --git a/resource/translations/ru/messages.php b/resource/translations/ru/messages.php index 3a1839f..b275ac6 100644 --- a/resource/translations/ru/messages.php +++ b/resource/translations/ru/messages.php @@ -23,6 +23,7 @@ return [ 'param_error' => ' Ошибка параметра', 'required_not_null' => ' Обязательное заполнение не может быть пустым.', 'picture_not_null' => ' Фотографии не могут быть пустыми', + 'follow_not_null' => ' Изображение и последующий контент не могут быть пустыми одновременно.X', 'contacts_not_null' => ' Контакты, почтовый ящик, телефон не может быть одновременно пустым', 'car_type_not_null' => ' Предпочтения не могут быть пустыми', 'channel_not_null' => ' Каналы не могут быть пустыми', diff --git a/resource/translations/zh/messages.php b/resource/translations/zh/messages.php index 96c3cb7..b8ca32d 100644 --- a/resource/translations/zh/messages.php +++ b/resource/translations/zh/messages.php @@ -23,6 +23,7 @@ return [ 'param_error' => ' 参数错误', 'required_not_null' => ' 必填项不能为空', 'picture_not_null' => ' 图片不能为空', + 'follow_not_null' => ' 图片与跟进内容不能同时为空', 'contacts_not_null' => ' 联系人,邮箱,电话不能同时为空', 'car_type_not_null' => ' 偏好不能为空', 'channel_not_null' => ' 渠道不能为空',