refactor: 删除 users 表中的冗余飞书字段
- 删除 feishu_user_id, feishu_open_id, tenant_key 字段 - JWT token 改用 feishu_app_id 代替 feishu_user_id - 删除废弃的 FeishuService::sendApprovalMessage() 方法 - 更新 User 模型移除废弃字段和 scope 方法 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,11 +10,6 @@ class User extends Model
|
||||
|
||||
/**
|
||||
* 可填充字段
|
||||
*
|
||||
* 注意:以下字段已废弃,保留仅用于向后兼容
|
||||
* @deprecated feishu_user_id - 请使用 UserFeishuApp 模型获取
|
||||
* @deprecated feishu_open_id - 请使用 UserFeishuApp 模型获取
|
||||
* @deprecated tenant_key - 请使用 UserFeishuApp 模型获取
|
||||
*/
|
||||
protected $fillable = [
|
||||
'company_id',
|
||||
@@ -28,13 +23,8 @@ class User extends Model
|
||||
'password',
|
||||
'status',
|
||||
'user_type',
|
||||
'union_id',
|
||||
// 废弃字段 - 请使用 UserFeishuApp 模型
|
||||
'feishu_user_id', // @deprecated
|
||||
'feishu_open_id', // @deprecated
|
||||
'tenant_key', // @deprecated
|
||||
// 保留字段:记录最后登录的应用,用于快速获取默认应用
|
||||
'feishu_app_id',
|
||||
'union_id', // 飞书 UnionID - 用于跨应用识别用户
|
||||
'feishu_app_id', // 最后登录的飞书应用ID - 用于快速获取默认应用
|
||||
'position',
|
||||
'sign_img',
|
||||
];
|
||||
@@ -149,21 +139,9 @@ class User extends Model
|
||||
return $query->where('company_id', $companyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据飞书用户ID查找
|
||||
* @deprecated 请通过 UserFeishuApp 模型查询
|
||||
*/
|
||||
public function scopeByFeishuUserId($query, ?string $feishuUserId)
|
||||
{
|
||||
if ($feishuUserId === null) {
|
||||
return $query;
|
||||
}
|
||||
return $query->where('feishu_user_id', $feishuUserId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据飞书 UnionID 查找
|
||||
* union_id 用于跨应用识别用户,保留此方法
|
||||
* union_id 用于跨应用识别用户
|
||||
*/
|
||||
public function scopeByFeishuUnionId($query, ?string $feishuUnionId)
|
||||
{
|
||||
@@ -173,18 +151,6 @@ class User extends Model
|
||||
return $query->where('union_id', $feishuUnionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据OpenID查找
|
||||
* @deprecated 请通过 UserFeishuApp 模型查询
|
||||
*/
|
||||
public function scopeByFeishuOpenId($query, ?string $openId)
|
||||
{
|
||||
if ($openId === null) {
|
||||
return $query;
|
||||
}
|
||||
return $query->where('feishu_open_id', $openId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索用户
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user