Просмотр исходного кода

渠道码分类下有渠道码,无法删除

evoxwht 2 лет назад
Родитель
Сommit
abb3b17a51
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      crmeb/app/services/wechat/WechatQrcodeCateServices.php

+ 2 - 0
crmeb/app/services/wechat/WechatQrcodeCateServices.php

@@ -69,6 +69,8 @@ class WechatQrcodeCateServices extends BaseServices
      */
     public function delCate($id = 0)
     {
+        $count = app()->make(WechatQrcodeServices::class)->count(['cate_id' => $id]);
+        if ($count) throw new AdminException(400454);
         if (!$id) throw new AdminException(100100);
         $res = $this->dao->update($id, ['is_del' => 1]);
         if (!$res) throw new AdminException(100008);