123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
- namespace app\controller\supplier\finance;
- use app\services\supplier\finance\SupplierFlowingWaterServices;
- use think\facade\App;
- use app\controller\supplier\AuthController;
- class SupplierFlowingWater extends AuthController
- {
-
- public function __construct(App $app, SupplierFlowingWaterServices $services)
- {
- parent::__construct($app);
- $this->services = $services;
- }
-
- public function index()
- {
- $where = $this->request->getMore([
- ['type', ''],
- ['data', '', '', 'time'],
- ]);
- $where['keyword'] = $this->request->param('keyword', '');
- $where['supplier_id'] = $this->supplierId;
- $where['is_del'] = 0;
- return app('json')->success($this->services->getList($where));
- }
-
- public function mark($id)
- {
- [$mark] = $this->request->postMore([
- ['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, ['mark' => $mark])) {
- return app('json')->fail('备注失败');
- }
- return app('json')->success('备注成功');
- }
-
- public function getType()
- {
- return app('json')->success($this->services->type);
- }
-
- public function fundRecord()
- {
- $where = $this->request->getMore([
- ['timeType', 'day'],
- ['data', '', '', 'time'],
- ]);
- $where['supplier_id'] = $this->supplierId;
- return app('json')->success($this->services->getFundRecord($where));
- }
-
- public function fundRecordInfo()
- {
- $where = $this->request->getMore([
- ['ids', '']
- ]);
- $where['keyword'] = $this->request->param('keyword', '');
- $where['id'] = $where['ids'] ? explode(',', $where['ids']) : [];
- unset($where['ids']);
- $where['is_del'] = 0;
- $where['supplier_id'] = $this->supplierId;
- return app('json')->success($this->services->getList($where));
- }
- }
|