正在显示
1 个修改的文件
包含
16 行增加
和
10 行删除
@@ -149,11 +149,14 @@ class House extends Backend | @@ -149,11 +149,14 @@ class House extends Backend | ||
149 | //小区id | 149 | //小区id |
150 | $house_id = $this->model->getLastInsID(); | 150 | $house_id = $this->model->getLastInsID(); |
151 | $data = Db::name('house')->where('id',$house_id)->find(); | 151 | $data = Db::name('house')->where('id',$house_id)->find(); |
152 | - $house_admin = Db::name('house_admin')->where('house_id',$house_id)->find(); | ||
153 | - Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]); | ||
154 | - if($house_admin) { | ||
155 | - Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']); | ||
156 | - } | 152 | +// $house_admin = Db::name('house_admin')->where('house_id',$house_id)->find(); |
153 | +// Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]); | ||
154 | +// if($house_admin) { | ||
155 | +// Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']); | ||
156 | +// } | ||
157 | + // 把修改后的管理员状态更新 | ||
158 | + Db::name('house_admin')->where('house_id',$house_id)->where('is_direct',1)->update(['house_id'=>'']); | ||
159 | + Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id,'is_direct'=>1]); | ||
157 | 160 | ||
158 | // Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]); | 161 | // Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$house_id]); |
159 | $url = request()->domain().'/index/index/hourse?id='.$house_id; | 162 | $url = request()->domain().'/index/index/hourse?id='.$house_id; |
@@ -234,11 +237,14 @@ class House extends Backend | @@ -234,11 +237,14 @@ class House extends Backend | ||
234 | } | 237 | } |
235 | $result = $row->allowField(true)->save($params); | 238 | $result = $row->allowField(true)->save($params); |
236 | $data = Db::name('house')->where('id',$ids)->find(); | 239 | $data = Db::name('house')->where('id',$ids)->find(); |
237 | - $house_admin = Db::name('house_admin')->where('house_id',$ids)->find(); | ||
238 | - Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids]); | ||
239 | - if($house_admin) { | ||
240 | - Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']); | ||
241 | - } | 240 | +// $house_admin = Db::name('house_admin')->where('house_id',$ids)->find(); |
241 | +// Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids]); | ||
242 | +// if($house_admin) { | ||
243 | +// Db::name('house_admin')->where('id',$house_admin['id'])->update(['house_id'=>'']); | ||
244 | +// } | ||
245 | + // 把修改后的管理员状态更新 | ||
246 | + Db::name('house_admin')->where('house_id',$ids)->where('is_direct',1)->update(['house_id'=>'']); | ||
247 | + Db::name('house_admin')->where('id',$data['admin_user_id'])->update(['house_id'=>$ids,'is_direct'=>1]); | ||
242 | 248 | ||
243 | Db::commit(); | 249 | Db::commit(); |
244 | } catch (ValidateException $e) { | 250 | } catch (ValidateException $e) { |
-
请 注册 或 登录 后发表评论