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) +;