'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'); } }