modified 优化数据库模型,自建表关联

This commit is contained in:
zhaoxiang 2019-05-19 02:32:32 +08:00
parent 102362e84a
commit d3eceaf8b0
3 changed files with 6 additions and 2 deletions

View File

@ -11,7 +11,7 @@ namespace app\model;
class AdminAuthGroup extends Base {
public function rules() {
return $this->hasMany('AdminAuthRule', 'groupId', 'id');
return $this->hasMany('AdminAuthRule', 'group_id', 'id');
}
}

View File

@ -4,5 +4,5 @@ namespace app\model;
class AdminMenu extends Base {
//
}

View File

@ -10,4 +10,8 @@ namespace app\model;
class AdminUser extends Base {
protected $autoWriteTimestamp = true;
public function userData() {
return $this->hasOne('AdminUserData', 'uid', 'id');
}
}