From 946f0f55ece31b009fb81cfbdde082fe5330ca57 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Wed, 10 Jan 2024 14:42:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E8=90=A5=E9=94=80=20-=20=E7=A7=AF=E5=88=86?= =?UTF-8?q?=20-=20=E7=A7=AF=E5=88=86=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9C=AA=E6=98=BE=E7=A4=BA=E4=BB=BB=E4=BD=95=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/config/SystemConfigClassifyDao.php | 2 +- app/common/dao/system/groupData/GroupDao.php | 2 +- app/common/dao/system/sms/SmsRecordDao.php | 2 +- app/controller/admin/system/config/Config.php | 22 +++++-------------- route/merchant/config.php | 6 +++-- 5 files changed, 12 insertions(+), 22 deletions(-) diff --git a/app/common/dao/system/config/SystemConfigClassifyDao.php b/app/common/dao/system/config/SystemConfigClassifyDao.php index f154c76..bd7b6e6 100644 --- a/app/common/dao/system/config/SystemConfigClassifyDao.php +++ b/app/common/dao/system/config/SystemConfigClassifyDao.php @@ -81,7 +81,7 @@ class SystemConfigClassifyDao extends BaseDao * @author xaboy * @day 2020-03-31 */ - public function count() + public function count(array $where = []): int { return SystemConfigClassify::getDB()->count(); } diff --git a/app/common/dao/system/groupData/GroupDao.php b/app/common/dao/system/groupData/GroupDao.php index d6f653c..b8be6b8 100644 --- a/app/common/dao/system/groupData/GroupDao.php +++ b/app/common/dao/system/groupData/GroupDao.php @@ -53,7 +53,7 @@ class GroupDao extends BaseDao * @author xaboy * @day 2020-04-01 */ - public function count() + public function count(array $where = []): int { return SystemGroup::getDB()->count(); } diff --git a/app/common/dao/system/sms/SmsRecordDao.php b/app/common/dao/system/sms/SmsRecordDao.php index ec4fdb6..36c4918 100644 --- a/app/common/dao/system/sms/SmsRecordDao.php +++ b/app/common/dao/system/sms/SmsRecordDao.php @@ -49,7 +49,7 @@ class SmsRecordDao extends BaseDao * @author xaboy * @day 2020-05-18 */ - public function count() + public function count(array $where = []): int { return SmsRecord::count($this->getPk()); } diff --git a/app/controller/admin/system/config/Config.php b/app/controller/admin/system/config/Config.php index a9ab11a..ba4d4c9 100644 --- a/app/controller/admin/system/config/Config.php +++ b/app/controller/admin/system/config/Config.php @@ -182,25 +182,13 @@ class Config extends BaseController return app('json')->success('删除成功'); } - /** - * @param string $key - * @param ConfigClassifyRepository $configClassifyRepository - * @return mixed - * @throws DataNotFoundException - * @throws DbException - * @throws FormBuilderException - * @throws ModelNotFoundException - * @author xaboy - * @day 2020-04-22 - */ + public function form($key, ConfigClassifyRepository $configClassifyRepository) { - if (!$configClassifyRepository->keyExists($key) || !($configClassfiy = $configClassifyRepository->keyByData($key))) - return app('json')->fail('配置分类不存在'); - if ($configClassifyRepository->existsWhere(['pid' => $configClassfiy->config_classify_id])) - $form = $this->repository->tabForm($configClassfiy, $this->request->merId()); - else - $form = $this->repository->cidByFormRule($configClassfiy, $this->request->merId()); + if (!$configClassifyRepository->keyExists($key) || !($configClassfiy = $configClassifyRepository->keyByData($key))) return app('json')->fail('配置分类不存在'); + if ($configClassifyRepository->existsWhere(['pid' => $configClassfiy->config_classify_id])) $form = $this->repository->tabForm($configClassfiy, $this->request->merId()); + else $form = $this->repository->cidByFormRule($configClassfiy, $this->request->merId()); + return app('json')->success(formToData($form)); } diff --git a/route/merchant/config.php b/route/merchant/config.php index 1bf963f..ccfdb9a 100644 --- a/route/merchant/config.php +++ b/route/merchant/config.php @@ -36,8 +36,10 @@ Route::group(function () { ]); -})->middleware(AllowOriginMiddleware::class) +}) + ->middleware(AllowOriginMiddleware::class) ->middleware(MerchantTokenMiddleware::class, true) ->middleware(MerchantAuthMiddleware::class) ->middleware(MerchantCheckBaseInfoMiddleware::class) - ->middleware(LogMiddleware::class); + ->middleware(LogMiddleware::class) +;