multi-store/app/store/controller/WorkbenchController.php

69 lines
2.3 KiB
PHP
Raw Normal View History

2024-06-01 16:07:53 +08:00
<?php
namespace app\store\controller;
2024-06-07 17:28:02 +08:00
use app\common\controller\Definitions;
2024-06-01 16:07:53 +08:00
use app\store\logic\WorkbenchLogic;
2024-06-03 11:03:08 +08:00
use hg\apidoc\annotation as ApiDoc;
2024-06-01 16:07:53 +08:00
2024-06-07 17:28:02 +08:00
#[ApiDoc\Title('工作台')]
2024-06-01 16:07:53 +08:00
class WorkbenchController extends BaseAdminController
{
2024-06-07 17:28:02 +08:00
#[
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"),
]
2024-06-01 16:07:53 +08:00
public function index()
{
2024-06-07 17:28:02 +08:00
$params = $this->request->get();
$params['store_id'] = $this->request->adminInfo['store_id'];
$result = WorkbenchLogic::index($params);
2024-06-01 16:07:53 +08:00
return $this->data($result);
}
2024-06-07 17:28:02 +08:00
#[
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()
{
$storeId = $this->request->adminInfo['store_id'];
$result = WorkbenchLogic::index($storeId);
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::index($storeId);
return $this->data($result);
}
2024-06-01 16:07:53 +08:00
}