49 lines
1.0 KiB
PHP
49 lines
1.0 KiB
PHP
|
|
<?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');
|
||
|
|
}
|
||
|
|
}
|