Merge branch 'release'

This commit is contained in:
mzl
2025-11-03 18:16:51 +08:00
parent a0935c4332
commit 359755fdf1
38 changed files with 2339 additions and 36 deletions
+39 -2
View File
@@ -2,6 +2,8 @@
namespace app\process;
use app\common\model\FinPaymentApply;
use app\common\model\User;
use app\crm\model\Customer;
use support\Log;
use Workerman\Crontab\Crontab;
@@ -11,7 +13,7 @@ class Task
public function onWorkerStart()
{
// 每半小时执行一次
// 每半小时执行一次,通知待跟进客户
new Crontab('0 */30 * * * *', function(){
echo date('Y-m-d H:i:s') . "\n";
Log::info('send follow start',[time()]);
@@ -41,7 +43,42 @@ class Task
$item->save();
}
Log::info('send follow start',[time()]);
Log::info('send follow end',[time()]);
});
// 检查入账资料是否提交
new Crontab('* */70 * * * *', function () {
$G = date('G');
if ($G > 22 || $G < 8) {
return;
}
Log::info('fin_payment_apply submit_files start', [time()]);
$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();
}
Log::info('fin_payment_apply submit_files end', [time()]);
});
}