|
@@ -180,6 +180,20 @@ class Exclusive extends Base
|
|
|
if (!empty($child_id)) throw new Exception('请先禁用全部子级');
|
|
|
|
|
|
}
|
|
|
+ }else{
|
|
|
+ //如果它的兄弟全部禁用的话,连同它的父级也禁用
|
|
|
+ $normal_c = Db::name('exclusive')
|
|
|
+ ->field('id')
|
|
|
+ ->where(['pid' => $res['pid'], 'is_del' => 0, 'status' => 1])
|
|
|
+ ->where('id', '<>', $param['id'])
|
|
|
+ ->find();
|
|
|
+
|
|
|
+ if (empty($normal_c)) {
|
|
|
+ Db::name('exclusive')
|
|
|
+ ->where(['id' => $res['pid'], 'status' => 1])
|
|
|
+ ->update(['status' => 0, 'updatetime' => date('Y-m-d H:i:s')]);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|