Files
huangjingfen/pro_v3.5.1/app/controller/admin/v1/supplier/SupplierTransactions.php
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

112 lines
2.9 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\controller\admin\v1\supplier;
use think\annotation\Inject;
use think\facade\App;
use app\controller\admin\AuthController;
use app\services\supplier\finance\SupplierTransactionsServices;
/**
* 门店流水
* Class StoreFinanceFlow
* @package app\controller\admin\v1\store
*/
class SupplierTransactions extends AuthController
{
/**
* @var SupplierTransactionsServices
*/
#[Inject]
protected SupplierTransactionsServices $services;
/**
* 显示资源列表
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index()
{
$where = $this->request->getMore([
['data', '', '', 'time'],
['store_id', '']
]);
$where['keyword'] = $this->request->param('keyword', '');
$where['is_del'] = 0;
$where['trade_type'] = 1;
$where['no_type'] = 2;
return app('json')->success($this->services->getList($where));
}
/**
* 增加备注
* @param $id
* @return mixed
*/
public function mark($id)
{
[$mark] = $this->request->getMore([
['mark', '']
], true);
if (!$id || !$mark) {
return app('json')->fail('缺少参数');
}
$info = $this->services->get((int)$id);
if (!$info) {
return app('json')->fail('账单流水不存在');
}
if (!$this->services->update($id, ['remark' => $mark])) {
return app('json')->fail('备注失败');
}
return app('json')->success('备注成功');
}
/**
* 账单记录
* @return mixed
*/
public function fundRecord()
{
$where = $this->request->getMore([
['timeType', 'day'],
['data', '', '', 'time'],
['store_id', '']
]);
$where['trade_type'] = 1;
$where['no_type'] = 1;
return app('json')->success($this->services->getFundRecord($where));
}
/**
* 账单详情
* @param $ids
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function fundRecordInfo()
{
$where = $this->request->getMore([
['ids', ''],
['store_id', '']
]);
$where['keyword'] = $this->request->param('keyword', '');
$where['id'] = stringToIntArray($where['ids']);
unset($where['ids']);
$where['is_del'] = 0;
$where['trade_type'] = 1;
return app('json')->success($this->services->getList($where));
}
}