推拉函数与queue
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user