From a9091f394885ccea7c0cb3e4d8db2ced5cb71999 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 28 Aug 2023 14:18:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=8F=96=E5=95=86?= =?UTF-8?q?=E6=88=B7=E5=88=86=E7=B1=BB=E3=80=81=E5=BA=97=E9=93=BA=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 19 +++++++++++++++++++ route/api.php | 1 + 2 files changed, 20 insertions(+) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 8c494a6d..fe7c4f1a 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -17,6 +17,7 @@ namespace app\controller\api; use app\common\repositories\store\order\StoreOrderRepository; use app\common\repositories\store\order\StoreRefundOrderRepository; use app\common\repositories\system\notice\SystemNoticeConfigRepository; +use app\common\model\system\merchant\Merchant; use app\common\repositories\user\UserRepository; use app\common\repositories\user\UserSignRepository; use app\common\repositories\wechat\RoutineQrcodeRepository; @@ -890,6 +891,22 @@ class Auth extends BaseController } } + //获取商户分类类别和店铺类型类别 + public function merchantCate() + { + $cateList = Db::name('MerchantCategory')->field(['merchant_category_id', 'category_name'])->select(); + $typeList = [ + ['merchant_category_id' => Merchant::TypeStore ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeStore] ?? ''], + ['merchant_category_id' => Merchant::TypeTownSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeTownSupplyChain] ?? ''], + ['merchant_category_id' => Merchant::TypeSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeSupplyChain] ?? ''] + ]; + $data = [ + 'category' => $cateList, + 'type' => $typeList + ]; + return app('json')->success($data); + } + //根据地址信息查询汇总信息 public function orderStatistics() { @@ -898,6 +915,8 @@ class Auth extends BaseController $streetCode = $this->request->param('street_code', ''); $villageCode = $this->request->param('village_code', ''); $brigadeId = $this->request->param('brigade_id', 0); + $categoryId = $this->request->param('category_id', 0); + $typeId = $this->request->param('type_id', 0); $startDate = $this->request->param('start_date', ''); $endDate = $this->request->param('end_date', ''); $queryBuilder = Db::name('ProductOrderLog')->where('status', 1); diff --git a/route/api.php b/route/api.php index 1ca179d9..dfd69872 100644 --- a/route/api.php +++ b/route/api.php @@ -23,6 +23,7 @@ Route::group('api/', function () { Route::any('test', 'api.Auth/test'); Route::any('dotest', 'api.Auth/dotest'); Route::post('goods/take/:id', 'api.Auth/deliveryGoods'); + Route::get('merchant/cate', 'api.Auth/merchantCate'); Route::get('order/statistics', 'api.Auth/orderStatistics'); Route::get('region/order', 'api.Auth/orderList'); Route::get('region/merchant', 'api.Auth/merStatistics');