营销短信查询统计记录

This commit is contained in:
ASUS 2025-11-11 10:22:21 +08:00
parent e88b220650
commit 72e98210e7
1 changed files with 2 additions and 1 deletions

View File

@ -136,12 +136,13 @@ class QuerySmsStatus extends Command
}
// 营销短信发送失败成功统计
$sms_push_event_list = Db::name('sms_push_event')->where(['status' => 1])->select()->toArray();
$sms_push_event_list = Db::name('sms_push_event')->where(['status' => 1])->field('id')->select()->toArray();
if($sms_push_event_list) {
Log::info('营销短信发送失败成功统计开始->' . json_encode($sms_push_event_list));
foreach ($sms_push_event_list as $k => $v) {
$result = Db::table('sms_push_event_record')
->where('event_id', $v['id']) // 统一筛选 event_id=2 的数据
->where('type', 'sms')
->field([
// 1. event_id=2 的实际人数
'COUNT(*) AS total_count',