refactor: 删除 users 表中未使用的字段
- 删除 report_to(上级ID)字段 - 删除 position(职位)字段 - 更新 User 模型移除相关关联和类型转换 - 更新 BusinessTripService 移除 position 返回 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,6 @@ class User extends Model
|
||||
protected $fillable = [
|
||||
'company_id',
|
||||
'sn',
|
||||
'report_to',
|
||||
'name',
|
||||
'avatar',
|
||||
'sex',
|
||||
@@ -25,13 +24,11 @@ class User extends Model
|
||||
'user_type',
|
||||
'union_id', // 飞书 UnionID - 用于跨应用识别用户
|
||||
'feishu_app_id', // 最后登录的飞书应用ID - 用于快速获取默认应用
|
||||
'position',
|
||||
'sign_img',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'company_id' => 'integer',
|
||||
'report_to' => 'integer',
|
||||
'sex' => 'integer',
|
||||
'status' => 'integer',
|
||||
'user_type' => 'integer',
|
||||
@@ -51,22 +48,6 @@ class User extends Model
|
||||
return $this->belongsTo(Company::class, 'company_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 上级用户
|
||||
*/
|
||||
public function parent()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'report_to');
|
||||
}
|
||||
|
||||
/**
|
||||
* 下级用户
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(User::class, 'report_to');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户飞书应用绑定
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user