添加账单详情
This commit is contained in:
parent
e8a515eef1
commit
4aac0ff460
@ -66,6 +66,24 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
||||
$query->where('user_id', 'in', $userIds)->whereOr('financial_record_sn', 'like', "%{$this->params['keyword']}%");
|
||||
});
|
||||
})
|
||||
->when(!empty($this->params['date_type']) && !empty($this->params['date']), function (Query $query) {
|
||||
switch ($this->params['date_type']) {
|
||||
case 2:
|
||||
$start = new \DateTime($this->params['date']);
|
||||
$start = $start->getTimestamp();
|
||||
$end = $start + (86400 * 7);
|
||||
break;
|
||||
case 3:
|
||||
$start = strtotime($this->params['date']);
|
||||
$end = strtotime('+1 month', strtotime($this->params['date']));
|
||||
break;
|
||||
default:
|
||||
$start = strtotime($this->params['date']);
|
||||
$end = strtotime($this->params['date']) + 86400;
|
||||
break;
|
||||
}
|
||||
$query->whereBetweenTime('create_time', $start, $end);
|
||||
})
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($item) {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\store\controller\finance;
|
||||
|
||||
use app\admin\lists\store_finance_flow\StoreFinanceFlowLists;
|
||||
use app\common\controller\Definitions;
|
||||
use app\common\lists\StoreBillLists;
|
||||
use app\common\logic\StoreFinanceFlowLogic;
|
||||
@ -37,16 +38,17 @@ class StoreBillController extends BaseAdminController
|
||||
ApiDoc\NotHeaders(),
|
||||
ApiDoc\Author('中国队长'),
|
||||
ApiDoc\Param(name: 'id', type: 'int', require: true, desc: 'id'),
|
||||
ApiDoc\Param(name: 'remark', type: 'string', require: true, desc: '备注'),
|
||||
ApiDoc\Query(name: 'date_type', type: 'int', require: false, desc: '日期类型:1日账单,2周账单,3月账单'),
|
||||
ApiDoc\Query(name: 'date', type: 'string', require: false, desc: '日期,日账单:2021-01-01,周账单:2024-W23,月账单:2021-01'),
|
||||
ApiDoc\Query(name: 'staff_id', type: 'int', require: false, desc: '店员id'),
|
||||
ApiDoc\Query(name: 'keyword', type: 'string', require: false, desc: '流水号/用户昵称'),
|
||||
ApiDoc\Header(ref: [Definitions::class, "token"]),
|
||||
ApiDoc\Query(ref: [Definitions::class, "page"]),
|
||||
ApiDoc\ResponseSuccess("data", type: "array"),
|
||||
]
|
||||
public function detail(StoreFinanceFlowLogic $logic)
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->post('id');
|
||||
$remark = $this->request->post('remark');
|
||||
$logic->remark($id, $remark);
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
return $this->dataLists(new StoreFinanceFlowLists());
|
||||
}
|
||||
|
||||
#[
|
||||
|
Loading…
x
Reference in New Issue
Block a user