add 数据之眼-商品分类列表

This commit is contained in:
chenbo 2023-12-07 13:50:14 +08:00
parent 68f84782cc
commit c86ac98bf3
2 changed files with 25 additions and 3 deletions

View File

@ -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));
}
}

View File

@ -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 */