|
@@ -6,6 +6,7 @@ use app\model\CardModel;
|
|
|
use app\model\CommonModel;
|
|
|
use app\model\CompanyModel;
|
|
|
use app\model\GroupModel;
|
|
|
+use app\model\ThemeModel;
|
|
|
use think\Exception;
|
|
|
use think\exception\ValidateException;
|
|
|
use think\facade\Db;
|
|
@@ -128,9 +129,14 @@ class GroupLogic extends BaseLogic
|
|
|
//启禁用
|
|
|
public static function status(array $data = []): Json
|
|
|
{
|
|
|
- if($data['status'] == CommonModel::$status_normal){
|
|
|
+ if ($data['status'] == CommonModel::$status_normal) {
|
|
|
//启用组合时,要验证组合下是否有启用的手机主题
|
|
|
+ $rs = ThemeModel::field('id')
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'status' => CommonModel::$status_normal])
|
|
|
+ ->findOrEmpty()
|
|
|
+ ->isEmpty();
|
|
|
|
|
|
+ if ($rs) return json_show(CommonModel::$error_param, '该分组没有启用的手机主题,无法启用');
|
|
|
}
|
|
|
$res = GroupModel::where('id', $data['id'])
|
|
|
->where('status', '<>', $data['status'])
|