multi-store/app/store/controller/finance/StoreBillController.php
2024-06-07 10:05:28 +08:00

72 lines
2.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\store\controller\finance;
use app\common\controller\Definitions;
use app\common\lists\StoreBillLists;
use app\common\logic\StoreFinanceFlowLogic;
use app\store\controller\BaseAdminController;
use hg\apidoc\annotation as ApiDoc;
#[ApiDoc\title('账单记录')]
class StoreBillController extends BaseAdminController
{
#[
ApiDoc\Title('列表'),
ApiDoc\url('/store/finance/storeBill/lists'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Query(name: 'type', type: 'int', require: false, desc: '类型1日账单2周账单3月账单'),
ApiDoc\Query(name: 'start_time', type: 'string', require: false, desc: '开始时间'),
ApiDoc\Query(name: 'end_time', type: 'string', require: false, desc: '结束时间'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\Query(ref: [Definitions::class, "page"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
public function lists()
{
return $this->dataLists(new StoreBillLists());
}
#[
ApiDoc\Title('详情'),
ApiDoc\url('/store/finance/storeBill/detail'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Param(name: 'remark', type: 'string', require: true, desc: '备注'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
public function detail(StoreFinanceFlowLogic $logic)
{
$id = $this->request->post('id');
$remark = $this->request->post('remark');
$logic->remark($id, $remark);
return $this->success('操作成功', [], 1, 1);
}
#[
ApiDoc\Title('下载'),
ApiDoc\url('/store/finance/storeBill/download'),
ApiDoc\Method('GET'),
ApiDoc\NotHeaders(),
ApiDoc\Author('中国队长'),
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
ApiDoc\Param(name: 'remark', type: 'string', require: true, desc: '备注'),
ApiDoc\Header(ref: [Definitions::class, "token"]),
ApiDoc\ResponseSuccess("data", type: "array"),
]
public function download(StoreFinanceFlowLogic $logic)
{
$id = $this->request->post('id');
$remark = $this->request->post('remark');
$logic->remark($id, $remark);
return $this->success('操作成功', [], 1, 1);
}
}