From c86ac98bf3df3e3a77bc5710056f03d0085d2203 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 7 Dec 2023 13:50:14 +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 | 17 +++++++++++++++++ route/api.php | 11 ++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/controller/api/dataview/Product.php b/app/controller/api/dataview/Product.php index 4ed13fbc..e28d7a6c 100644 --- a/app/controller/api/dataview/Product.php +++ b/app/controller/api/dataview/Product.php @@ -3,6 +3,7 @@ namespace app\controller\api\dataview; +use app\common\repositories\store\product\ProductRepository; use app\common\repositories\store\StoreCategoryRepository as repository; use app\common\repositories\user\UserVisitRepository; use crmeb\basic\BaseController; @@ -280,4 +281,20 @@ class Product extends BaseController 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(); + $where = $this->request->params([['type', 1]]); + $where['is_gift_bag'] = 0; + $_where = $repository->switchType($where['type'], null,0); +// unset($_where['product_type']); + unset($_where['star']); + $where = array_merge($where, $_where); + return app('json')->success($repository->getAdminList(null, $where, $page, $limit)); + } } \ No newline at end of file diff --git a/route/api.php b/route/api.php index e39ded8f..aee89888 100644 --- a/route/api.php +++ b/route/api.php @@ -732,19 +732,24 @@ Route::group('api/', function () { /**---------------------数据之眼可视化大屏api------------------- start */ - // Order + // api.dataview.Order Route::get('order_statistics', 'Order/orderStatistics'); Route::get('sales_ranking', 'Order/salesRanking'); Route::get('curr_day_order_amount', 'Order/currDayOrderAmount'); - // User + // api.dataview.User Route::get('user_merchat_count', 'User/userMerchantCount'); Route::get('user_trade_count', 'User/userTradeCount'); - // Product + // api.dataview.Product Route::get('product_count', 'Product/productCount'); Route::get('view_count', 'Product/viewCount'); Route::get('product_category_list', 'Product/productCategoryList'); + Route::get('product_status_filter', 'Product/getStatusFilter'); + Route::get('product_list', 'Product/productList'); + + // api.dataview.Merchant + Route::get('merchant_list', 'Merchant/merchantList'); /**---------------------数据之眼可视化大屏api-------------------- end */