私域操盘手 - 重写微信号管理
This commit is contained in:
@@ -9,6 +9,9 @@ use think\Model;
|
||||
*/
|
||||
class DeviceWechatLogin extends Model
|
||||
{
|
||||
const ALIVE_WECHAT_ACTIVE = 1; // 微信在线
|
||||
const ALIVE_WECHAT_DIED = 0; // 微信离线
|
||||
|
||||
// 登录日志最新登录 alive = 1,旧数据全部设置0
|
||||
protected $name = 'device_wechat_login';
|
||||
|
||||
@@ -25,6 +28,10 @@ class DeviceWechatLogin extends Model
|
||||
*/
|
||||
public static function getDevicesLatestLogin(array $deviceIds): array
|
||||
{
|
||||
return self::fieldRaw('max(id) as lastedId,deviceId')->whereIn('deviceId', $deviceIds)->group('deviceId')->select()->toArray();
|
||||
return static::fieldRaw('max(id) as lastedId,deviceId')
|
||||
->whereIn('deviceId', $deviceIds)
|
||||
->group('deviceId')
|
||||
->select()
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user