Files
x-server-mobile/backend/app/model/FeishuLoginSession.php
T

49 lines
1.0 KiB
PHP
Raw Normal View History

2026-02-26 09:58:19 +08:00
<?php
namespace app\model;
use support\Model;
class FeishuLoginSession extends Model
{
protected $table = 'feishu_login_session';
protected $fillable = [
'company_id',
'tenant_key',
'status',
'user_id',
'expires_at',
];
protected $casts = [
'status' => 'string',
'user_id' => 'integer',
'company_id' => 'integer',
'expires_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];
const STATUS_PENDING = 'pending'; // 待扫码
const STATUS_SCANNING = 'scanning'; // 已扫码,待授权
const STATUS_SUCCESS = 'success'; // 登录成功
const STATUS_EXPIRED = 'expired'; // 已过期
/**
* 关联公司
*/
public function company()
{
return $this->belongsTo(Company::class, 'company_id');
}
/**
* 关联用户
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}