add 数据之眼-商户列表,订单列表,订单列表统计标题
This commit is contained in:
parent
c86ac98bf3
commit
c0407b656e
40
app/controller/api/dataview/Merchant.php
Normal file
40
app/controller/api/dataview/Merchant.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller\api\dataview;
|
||||
|
||||
use crmeb\basic\BaseController;
|
||||
use app\common\repositories\system\merchant\MerchantRepository as repository;
|
||||
use think\App;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
class Merchant extends BaseController
|
||||
{
|
||||
/**
|
||||
* @var repository
|
||||
*/
|
||||
protected $repository;
|
||||
|
||||
public $areaCode; // 区县地区码
|
||||
|
||||
public $streetCode; // 镇街道地区码
|
||||
|
||||
public function __construct(App $app, repository $repository)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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();
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user