私域操盘手 - 重写微信号管理

This commit is contained in:
柳清爽
2025-05-10 10:17:58 +08:00
parent 50cd82f5d3
commit c09864ee89
10 changed files with 306 additions and 204 deletions

View File

@@ -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();
}
}