推拉函数与queue

This commit is contained in:
cano
2024-03-03 09:39:06 +08:00
parent f5f7168009
commit 66d88ea2b3
15 changed files with 476 additions and 108 deletions

View File

@ -46,4 +46,17 @@ class CustomerWsHistoryModel extends CustomerBaseModel
->toArray();
}
//获取判断用户是否活跃
//@需要加入缓存-缓存时间为3天
function findActiveUserId($uid, $date, $days = 3): array
{
return $this->newQuery()
->where('uid', $uid)
->where('event', self::EVENT_ON_CONNECT)
->where('status', self::STATUS_SUCCESS)
->whereBetween(DB::raw("DATE_FORMAT(created_at,'%Y-%m-%d')"), [Carbon::parse($date)->subDays($days - 1)->toDateString(), Carbon::parse($date)->toDateString()])
->first(['uid'])
->toArray();
}
}