'int', 'name' => 'string', 'desc' => 'string', 'create_time' => 'int', 'update_time' => 'int', ]; protected $disuse = [ 'desc' ]; /** * 角色菜单关联 * @return \think\model\relation\HasMany */ public function RoleToMenu() { return $this->hasMany(RoleToMenu::class); } /** * 获取详情 * @param array $data * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getInfo(array $data):array { $result = $this->find($data['role_id']); return $result ? $result->toArray() : []; } }