From c0407b656ed89919ab2f97efebac3735f28478f5 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 7 Dec 2023 14:35:18 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=95=B0=E6=8D=AE=E4=B9=8B=E7=9C=BC-?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=88=97=E8=A1=A8=EF=BC=8C=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/dataview/Merchant.php | 40 ++++++++++++++++++++++++ app/controller/api/dataview/Order.php | 23 ++++++++++++++ app/controller/api/dataview/Product.php | 4 +++ route/api.php | 2 ++ 4 files changed, 69 insertions(+) create mode 100644 app/controller/api/dataview/Merchant.php diff --git a/app/controller/api/dataview/Merchant.php b/app/controller/api/dataview/Merchant.php new file mode 100644 index 00000000..d8cbc481 --- /dev/null +++ b/app/controller/api/dataview/Merchant.php @@ -0,0 +1,40 @@ +repository = $repository; + $this->areaCode = $this->request->param('areaCode', ''); + $this->streetCode = $this->request->param('streetCode', ''); + + if ($this->areaCode == '' && $this->streetCode == '') { + throw new ValidateException('请选择地区'); + } + } + + // 商户列表 + public function merchantList() + { + [$page, $limit] = $this->getPage(); + $where = $this->request->params([ 'status', 'statusTag', 'is_trader', 'category_id', 'type_id', 'area_id', 'street_id']); + return app('json')->success($this->repository->lst($where, $page, $limit)); + } +} \ No newline at end of file diff --git a/app/controller/api/dataview/Order.php b/app/controller/api/dataview/Order.php index e1914440..1151f0d6 100755 --- a/app/controller/api/dataview/Order.php +++ b/app/controller/api/dataview/Order.php @@ -3,6 +3,7 @@ namespace app\controller\api\dataview; use app\common\repositories\BaseRepository; +use app\common\repositories\store\order\StoreOrderRepository; use crmeb\basic\BaseController; use think\App; use think\exception\ValidateException; @@ -454,4 +455,26 @@ class Order extends BaseController return \app('json')->success(compact('geoStreetList')); } + + + // 订单列表 + public function orderList(StoreOrderRepository $repository) + { + [$page, $limit] = $this->getPage(); + $where = $this->request->params(['date','order_sn','order_type','keywords','username','mer_id','activity_type','group_order_sn','store_name']); + $where['reconciliation_type'] = $this->request->param('status', 1); + return app('json')->success($repository->adminMerGetList($where, $page, $limit)); + } + + // 订单列表统计标题 + public function orderCountTitle(StoreOrderRepository $repository) + { + $where = $this->request->params(['type', 'date', 'mer_id','keywords','status','username','order_sn','is_trader','activity_type']); + $data[0] = $repository->getStat($where, $where['status'])[0]; + $data[1] = $repository->getStat($where, $where['status'])[1]; + $data[2] = $repository->getStat($where, $where['status'])[2]; + return app('json')->success($data); + } + + } \ No newline at end of file diff --git a/app/controller/api/dataview/Product.php b/app/controller/api/dataview/Product.php index e28d7a6c..9c6d1ca3 100644 --- a/app/controller/api/dataview/Product.php +++ b/app/controller/api/dataview/Product.php @@ -236,6 +236,7 @@ class Product extends BaseController return compact('todayMerchantCount', 'yestertodayMerchantCount', 'weeklyMerchantGrowthRate'); } + // 实时浏览量 public function viewCount() { $res = Cache::store('file')->remember(self::class . '@viewCount', function () { @@ -276,16 +277,19 @@ class Product extends BaseController return (float)bcdiv(bcsub($today, $last, $scale), $last, $scale); } + // 商品分类列表 public function productCategoryList() { return app('json')->success($this->repository->getFormatList($this->request->merId())); } + // 商品列表统计标题 public function getStatusFilter(ProductRepository $repository) { return app('json')->success($repository->getFilter(null,'商品',0)); } + // 商品列表 public function productList(ProductRepository $repository) { [$page, $limit] = $this->getPage(); diff --git a/route/api.php b/route/api.php index aee89888..4737f9bf 100644 --- a/route/api.php +++ b/route/api.php @@ -736,6 +736,8 @@ Route::group('api/', function () { Route::get('order_statistics', 'Order/orderStatistics'); Route::get('sales_ranking', 'Order/salesRanking'); Route::get('curr_day_order_amount', 'Order/currDayOrderAmount'); + Route::get('order_list', 'Order/orderList'); + Route::get('order_list_count_title', 'Order/orderCountTitle'); // api.dataview.User Route::get('user_merchat_count', 'User/userMerchantCount');