160 lines
6.1 KiB
PHP
160 lines
6.1 KiB
PHP
<?php
|
|
|
|
namespace app\store\controller;
|
|
|
|
use app\common\controller\Definitions;
|
|
use app\store\logic\WorkbenchLogic;
|
|
use hg\apidoc\annotation as ApiDoc;
|
|
|
|
#[ApiDoc\Title('工作台')]
|
|
class WorkbenchController extends BaseAdminController
|
|
{
|
|
|
|
#[
|
|
ApiDoc\Title('交易统计'),
|
|
ApiDoc\url('/store/workbench/index'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function index()
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
$result = WorkbenchLogic::index($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('商品统计(暂时不用)'),
|
|
ApiDoc\url('/store/workbench/product'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function product()
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
$result = WorkbenchLogic::product($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('配送统计(暂时不用)'),
|
|
ApiDoc\url('/store/workbench/delivery'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function delivery()
|
|
{
|
|
$storeId = $this->request->adminInfo['store_id'];
|
|
$result = WorkbenchLogic::delivery($storeId);
|
|
return $this->data($result);
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('商品统计-概况'),
|
|
ApiDoc\url('/store/workbench/get_basic'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function get_basic(\app\admin\controller\WorkbenchController $workbench)
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
return $workbench->get_basic();
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('商品统计-图表'),
|
|
ApiDoc\url('/store/workbench/get_trend'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function get_trend(\app\admin\controller\WorkbenchController $workbench)
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
return $workbench->get_trend();
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('商品统计-排行'),
|
|
ApiDoc\url('/store/workbench/get_product_ranking'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function get_product_ranking(\app\admin\controller\WorkbenchController $workbench)
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
return $workbench->get_product_ranking();
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('用户统计-概况'),
|
|
ApiDoc\url('/store/workbench/get_user_basic'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function get_user_basic(\app\admin\controller\WorkbenchController $workbench)
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
return $workbench->get_user_basic();
|
|
}
|
|
|
|
#[
|
|
ApiDoc\Title('用户统计-图表'),
|
|
ApiDoc\url('/store/workbench/get_user_trend'),
|
|
ApiDoc\Method('GET'),
|
|
ApiDoc\NotHeaders(),
|
|
ApiDoc\Author('中国队长'),
|
|
ApiDoc\Query(name: 'start_time', type: 'string', require: true, desc: '开始时间'),
|
|
ApiDoc\Query(name: 'end_time', type: 'string', require: true, desc: '结束时间'),
|
|
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
|
ApiDoc\ResponseSuccess("data", type: "array"),
|
|
]
|
|
public function get_user_trend(\app\admin\controller\WorkbenchController $workbench)
|
|
{
|
|
$params = $this->request->get();
|
|
$params['store_id'] = $this->request->adminInfo['store_id'];
|
|
return $workbench->get_user_trend();
|
|
}
|
|
|
|
}
|