存客宝应用接口初始化

This commit is contained in:
Ghost
2026-01-05 10:25:32 +08:00
parent fa37227954
commit 02797ba50a
414 changed files with 85530 additions and 75 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace app\common\model;
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';
// 自动写入时间戳
protected $autoWriteTimestamp = true;
protected $createTime = 'createTime';
protected $updateTime = 'updateTime';
/**
* 获取设备最新登录记录的id
*
* @param array $deviceIds
* @return array
*/
public static function getDevicesLatestLogin(array $deviceIds): array
{
return static::fieldRaw('max(id) as lastedId,deviceId')
->whereIn('deviceId', $deviceIds)
->group('deviceId')
->select()
->toArray();
}
}