diff --git a/app/process/CheckWeb.php b/app/process/CheckWeb.php deleted file mode 100644 index aeca44c..0000000 --- a/app/process/CheckWeb.php +++ /dev/null @@ -1,66 +0,0 @@ -execute(); - }); - - new Crontab('*/50 * * * * *', function(){ - $userIds = User::where('status', 1)->pluck('id')->toArray(); - foreach ($userIds as $userId) { - $status = Redis::hGet('user:check:sign'.$userId, 'status'); - if ($status) { - continue; - } - $ws = new WsEvents(); - $ws->pushWebsocket('system.init.check', $userId, $ws->initCheck($userId)); - } - }); - } - - - public function tocurl($url, $header = null, $content = null) - { - $ch = curl_init(); - if(substr($url,0,5)=='https'){ - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 - curl_setopt($ch, CURLOPT_SSLVERSION, 1); - } - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_URL, $url); - if (is_array($header)) { - curl_setopt($ch, CURLOPT_HTTPHEADER, $header); - } - curl_setopt($ch, CURLOPT_POST, true); - if (!empty($content)) { - if (is_array($content)) { - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($content)); - } else if (is_string($content)) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $content); - } - } - $response = curl_exec($ch); - $error=curl_error($ch); - if($error){ - die($error); - } - $header = curl_getinfo($ch); - curl_close($ch); - $data = array('header' => $header,'body' => $response); - return $data; - } -} \ No newline at end of file diff --git a/app/process/Emails.php b/app/process/Emails.php deleted file mode 100644 index 2679f00..0000000 --- a/app/process/Emails.php +++ /dev/null @@ -1,58 +0,0 @@ -uids(); - // }); - - // // 邮件详情 - // new Crontab('0 */35 * * * *', function(){ - // $email = new EmailsUtils(); - // $email->details(); - // }); - - // // 邮件处理 - // new Crontab('0 */40 * * * *', function(){ - // $email = new EmailsUtils(); - // $email->process(); - // }); - - if (getenv('ENVIRONMENT') === 'master') { - // 拉取新邮件 - 每小时的第20分钟0秒执行 - new Crontab('0 */20 * * * *', function(){ - $email = new EmailsUtils(); - $email->uids(); - }); - - // 邮件详情 - 每小时的第25分钟0秒执行 - new Crontab('0 */25 * * * *', function(){ - $email = new EmailsUtils(); - $email->details(); - }); - - // 邮件处理 - 每小时的第30分钟0秒执行 - new Crontab('0 */30 * * * *', function(){ - $email = new EmailsUtils(); - $email->process(); - }); - - // 邮件分派 - 每小时的第35分钟0秒执行 - new Crontab('0 */35 * * * *', function(){ - $email = new EmailsUtils(); - $email->fenpai(); - }); - } - } - -} \ No newline at end of file diff --git a/app/process/Task.php b/app/process/Task.php deleted file mode 100644 index 47fe78f..0000000 --- a/app/process/Task.php +++ /dev/null @@ -1,83 +0,0 @@ -', time()], - ['warn', '<', 1] - ]; - $customer = Customer::where($where)->get(); - foreach ($customer as $item) { - $contacts = $item->contacts??$item['phone']; - $contacts = $contacts??$item['whatsApp']; - $contacts = $contacts??$item['email']; - $data = [ - 'sender_id' => 0, //发送人ID 0默认系统 - 'sender_type' => 'system', //发送者类型 user admin system - 'title' => '客户跟进提醒 - ' . $contacts, //标题 - 'content' => $contacts . ' 到达预定跟进时间,请及时跟进', //内容 - 'scene' => 1, //场景 0系统公共 1系统通知 - 'recipient' => [$item->user_id], //接收人 空为全部 - 'push_method' => 0 //推送方式0系统推送1手动推送 - ]; - \Webman\RedisQueue\Redis::send("notice",$data); - - $item->warn = 1; - $item->save(); - } - - Log::info('send follow end',[time()]); - }); - - // 检查入账资料是否提交 - new Crontab('* */70 * * * *', function () { - $G = date('G'); - if ($G > 22 || $G < 8) { - return; - } - $where = [ - ['submit_files', '=', ''], - ['warn', '<', 2], - ['created_at', '>', time() - 60 * 60 * 48], - ['created_at', '<', time() - 60 * 60 * 24], - ]; - $payment = FinPaymentApply::where($where)->orderBy('id', 'desc')->get(); - foreach ($payment as $item) { - Log::info('fin_payment_apply submit_files ', [$item->toArray()]); - $notice = [ - 'code' => $item->apply_no, - 'payment_entity' => $item->payment_entity ?? $item->remitter, - 'content' => '认领收款单后请在24小时内提交入账资料', - 'reply' => '', - ]; - $email = []; - $email[] = User::where('id', $item->claimed_by)->value('email'); - $email[] = User::where('id', $item->doc_user_id)->value('email'); - $email = array_unique($email); - \app\common\utils\email\MailSend::send($email, '【XYH】付款记录', replaceTpl($notice, 'payment_files')); - - $item->warn = ++$item->warn; - $item->save(); - } - - }); - } - -} \ No newline at end of file diff --git a/config/plugin/webman/gateway-worker/app.php b/config/plugin/webman/gateway-worker/app.php deleted file mode 100644 index 8f9c426..0000000 --- a/config/plugin/webman/gateway-worker/app.php +++ /dev/null @@ -1,4 +0,0 @@ - true, -]; \ No newline at end of file diff --git a/config/plugin/webman/gateway-worker/process.php b/config/plugin/webman/gateway-worker/process.php deleted file mode 100644 index 16180d9..0000000 --- a/config/plugin/webman/gateway-worker/process.php +++ /dev/null @@ -1,39 +0,0 @@ - [ - 'handler' => Gateway::class, - 'listen' => 'websocket://0.0.0.0:' . getenv('GATEWAY_LISTEN'), - 'count' => 3, - 'reloadable' => false, - 'constructor' => ['config' => [ - 'lanIp' => '127.0.0.1', - 'startPort' => 2300, - 'pingInterval' => 55, - 'pingNotResponseLimit' => 1, - 'pingData' => '', - 'registerAddress' => '127.0.0.1:1236', - 'onConnect' => function(){}, - ]] - ], - 'worker' => [ - 'handler' => BusinessWorker::class, - 'count' => 2, - 'constructor' => ['config' => [ - 'eventHandler' => plugin\webman\gateway\Events::class, - 'name' => 'ChatBusinessWorker', - 'registerAddress' => '127.0.0.1:1236', - ]] - ], - 'register' => [ - 'handler' => Register::class, - 'listen' => 'text://127.0.0.1:1236', - 'count' => 1, // Must be 1 - 'reloadable' => false, - 'constructor' => [] - ], -]; diff --git a/config/plugin/webman/redis-queue/process.php b/config/plugin/webman/redis-queue/process.php index 8474aee..58735ee 100644 --- a/config/plugin/webman/redis-queue/process.php +++ b/config/plugin/webman/redis-queue/process.php @@ -1,12 +1,12 @@ [ - 'handler' => Webman\RedisQueue\Process\Consumer::class, - 'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费 - 'constructor' => [ - // 消费者类目录 - 'consumer_dir' => app_path() . '/queue/redis', - 'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR') - ] - ] +// 'consumer' => [ +// 'handler' => Webman\RedisQueue\Process\Consumer::class, +// 'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费 +// 'constructor' => [ +// // 消费者类目录 +// 'consumer_dir' => app_path() . '/queue/redis', +// 'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR') +// ] +// ] ]; \ No newline at end of file diff --git a/config/process.php b/config/process.php index 8022ef3..f404f22 100644 --- a/config/process.php +++ b/config/process.php @@ -60,13 +60,4 @@ return [ ] ] ], - 'task' => [ - 'handler' => app\process\Task::class - ], - 'email' => [ - 'handler' => app\process\Emails::class - ], - 'checkweb' => [ - 'handler' => app\process\CheckWeb::class - ], ];