From 68f84782ccf9db9e62f777217e4d20b9143bdd63 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 7 Dec 2023 11:32:49 +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=E5=93=81=E5=88=86=E7=B1=BB=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/dataview/Product.php | 13 ++++++++----- route/api.php | 12 +++++++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/controller/api/dataview/Product.php b/app/controller/api/dataview/Product.php index 7f124945..4ed13fbc 100644 --- a/app/controller/api/dataview/Product.php +++ b/app/controller/api/dataview/Product.php @@ -2,10 +2,8 @@ namespace app\controller\api\dataview; -use app\common\repositories\BaseRepository; -use app\common\repositories\store\order\StoreOrderRepository; -use app\common\repositories\system\merchant\MerchantRepository; -use app\common\repositories\user\UserRepository; + +use app\common\repositories\store\StoreCategoryRepository as repository; use app\common\repositories\user\UserVisitRepository; use crmeb\basic\BaseController; use think\App; @@ -23,7 +21,7 @@ class Product extends BaseController public $streetCode; // 镇街道地区码 - public function __construct(App $app, BaseRepository $repository) + public function __construct(App $app, repository $repository) { parent::__construct($app); $this->repository = $repository; @@ -277,4 +275,9 @@ 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())); + } + } \ No newline at end of file diff --git a/route/api.php b/route/api.php index 8964e535..e39ded8f 100644 --- a/route/api.php +++ b/route/api.php @@ -731,14 +731,20 @@ Route::group('api/', function () { /**---------------------数据之眼可视化大屏api------------------- start */ - Route::get('user_merchat_count', 'User/userMerchantCount'); + + // Order Route::get('order_statistics', 'Order/orderStatistics'); Route::get('sales_ranking', 'Order/salesRanking'); Route::get('curr_day_order_amount', 'Order/currDayOrderAmount'); - Route::get('product_count', 'Product/productCount'); - Route::get('view_count', 'Product/viewCount'); + + // User + Route::get('user_merchat_count', 'User/userMerchantCount'); Route::get('user_trade_count', 'User/userTradeCount'); + // Product + Route::get('product_count', 'Product/productCount'); + Route::get('view_count', 'Product/viewCount'); + Route::get('product_category_list', 'Product/productCategoryList'); /**---------------------数据之眼可视化大屏api-------------------- end */