...
|
...
|
@@ -59,7 +59,14 @@ class HouseAdmin extends Api |
|
|
$house_id = $this->request->param('house_id');
|
|
|
if($house_id){
|
|
|
$info = HouseAdminModel::get(['user_id'=>$user_id,'house_id'=>$house_id],['house']);
|
|
|
empty($info) && $this->error('您不是该小区的管理员');
|
|
|
// empty($info) && $this->error('您不是该小区的管理员');
|
|
|
if(empty($info)) {
|
|
|
$info = HouseAdminModel::with(['house'])
|
|
|
->where(['user_id'=>$user_id])
|
|
|
->order(['is_direct'=>'asc','createtime'=>'asc'])
|
|
|
->field('id,house_id,is_direct,nickname,avatar')
|
|
|
->find();
|
|
|
};
|
|
|
$info->visible(['id','house_id','is_direct','nickname','avatar','house'])->toArray();
|
|
|
}else{
|
|
|
$info = HouseAdminModel::with(['house'])
|
...
|
...
|
|