...
|
...
|
@@ -498,7 +498,10 @@ class HouseAdmin extends Api |
|
|
}
|
|
|
|
|
|
Db::startTrans();
|
|
|
$result = (new HouseAdminModel)->allowField(true)->save(array_merge([
|
|
|
if(!$houseAdminModel = HouseAdminModel::get(['user_id'=>$admin_user['id'],'house_id'=>0])){
|
|
|
$houseAdminModel = new HouseAdminModel;
|
|
|
}
|
|
|
$result = $houseAdminModel->allowField(true)->save(array_merge([
|
|
|
'user_id' => $admin_user['id'],
|
|
|
'avatar' => $admin_user['avatar'],
|
|
|
'is_direct' => 2
|
...
|
...
|
@@ -511,7 +514,7 @@ class HouseAdmin extends Api |
|
|
Db::rollback();
|
|
|
$this->error('添加管理员失败');
|
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
|
$this->success('success');
|
|
|
}
|
|
|
|
...
|
...
|
|