...
|
...
|
@@ -149,11 +149,14 @@ class House extends Backend |
|
|
//小区id
|
|
|
$house_id = $this->model->getLastInsID();
|
|
|
$data = Db::name('house')->where('id',$house_id)->find();
|
|
|
$house_admin = Db::name('house_admin')->where('house_id',$house_id)->find();
|
|
|
Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]);
|
|
|
if($house_admin) {
|
|
|
Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']);
|
|
|
}
|
|
|
// $house_admin = Db::name('house_admin')->where('house_id',$house_id)->find();
|
|
|
// Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]);
|
|
|
// if($house_admin) {
|
|
|
// Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']);
|
|
|
// }
|
|
|
// 把修改后的管理员状态更新
|
|
|
Db::name('house_admin')->where('house_id',$house_id)->where('is_direct',1)->update(['house_id'=>'']);
|
|
|
Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id,'is_direct'=>1]);
|
|
|
|
|
|
// Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]);
|
|
|
$url = request()->domain().'/index/index/hourse?id='.$house_id;
|
...
|
...
|
@@ -234,11 +237,14 @@ class House extends Backend |
|
|
}
|
|
|
$result = $row->allowField(true)->save($params);
|
|
|
$data = Db::name('house')->where('id',$ids)->find();
|
|
|
$house_admin = Db::name('house_admin')->where('house_id',$ids)->find();
|
|
|
Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids]);
|
|
|
if($house_admin) {
|
|
|
Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']);
|
|
|
}
|
|
|
// $house_admin = Db::name('house_admin')->where('house_id',$ids)->find();
|
|
|
// Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids]);
|
|
|
// if($house_admin) {
|
|
|
// Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']);
|
|
|
// }
|
|
|
// 把修改后的管理员状态更新
|
|
|
Db::name('house_admin')->where('house_id',$ids)->where('is_direct',1)->update(['house_id'=>'']);
|
|
|
Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids,'is_direct'=>1]);
|
|
|
|
|
|
Db::commit();
|
|
|
} catch (ValidateException $e) {
|
...
|
...
|
|