From 3f9fb63437d8897bbeb8698992fc20645b79c721 Mon Sep 17 00:00:00 2001 From: liuxiaoquan Date: Fri, 17 Mar 2023 01:01:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=9B=9E=E4=BF=9D=E8=AF=81=E9=87=91bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchant/system/financial/Financial.php | 95 +++++++++---------- .../merchant/system/merchant/margin/edit.html | 2 - .../merchant/system/merchant/margin/list.html | 52 ++++++---- .../merchant/system/financial/Financial.php | 3 +- 4 files changed, 79 insertions(+), 73 deletions(-) diff --git a/app/admin/controller/merchant/system/financial/Financial.php b/app/admin/controller/merchant/system/financial/Financial.php index 03daf84..b6ee414 100644 --- a/app/admin/controller/merchant/system/financial/Financial.php +++ b/app/admin/controller/merchant/system/financial/Financial.php @@ -14,10 +14,14 @@ use think\App; use think\Request; use app\admin\BaseController; use app\common\model\merchant\system\financial\Financial as FinancialModel; +use think\facade\View; class Financial extends BaseController { protected $model; + protected $path = [ + + ]; public function __construct(App $app, FinancialModel $model) { @@ -26,6 +30,23 @@ class Financial extends BaseController $this->model = $model; } + /** + * 备注表单页 + */ + public function markForm() + { + return View(); + } + + /** + * 审核表单页 + */ + public function statusForm() + { + return View(); + } + + /** * 余额退还记录 */ @@ -63,68 +84,38 @@ class Financial extends BaseController /** - * 显示创建资源表单页. + * 退回保证金审核 * * @return \think\Response */ - public function create() + public function switchStatus() { - // + $data = $this->request->params([['status',0], 'refusal']); + $type = $this->request->param('type',0); + $data['status_time'] = date('Y-m-d H:i:s'); + if (!in_array($data['status'], [0,1,-1])) { + return app('json')->fail('审核状态错误'); + } + if (($data['status'] == -1) && empty($data['refusal'])) { + return app('json')->fail('请输入拒绝理由'); + } + $this->repository->switchStatus($id, $type, $data); + return app('json')->success('审核完成'); } /** - * 保存新建的资源 - * - * @param \think\Request $request - * @return \think\Response + * 备注 */ - public function save(Request $request) + public function mark() { - // + $ret = $this->repository->getWhere([$this->repository->getPk() => $id]); + + if(!$ret) return app('json')->fail('数据不存在'); + $data = $this->request->params(['admin_mark']); + $this->repository->update($id,$data); + + return app('json')->success('备注成功'); } - /** - * 显示指定的资源 - * - * @param int $id - * @return \think\Response - */ - public function read($id) - { - // - } - /** - * 显示编辑资源表单页. - * - * @param int $id - * @return \think\Response - */ - public function edit($id) - { - // - } - - /** - * 保存更新的资源 - * - * @param \think\Request $request - * @param int $id - * @return \think\Response - */ - public function update(Request $request, $id) - { - // - } - - /** - * 删除指定资源 - * - * @param int $id - * @return \think\Response - */ - public function delete($id) - { - // - } } diff --git a/app/admin/view/merchant/system/merchant/margin/edit.html b/app/admin/view/merchant/system/merchant/margin/edit.html index dc722a9..4bb8f93 100644 --- a/app/admin/view/merchant/system/merchant/margin/edit.html +++ b/app/admin/view/merchant/system/merchant/margin/edit.html @@ -21,8 +21,6 @@ - diff --git a/app/admin/view/merchant/system/merchant/margin/list.html b/app/admin/view/merchant/system/merchant/margin/list.html index d28a978..0fe994e 100644 --- a/app/admin/view/merchant/system/merchant/margin/list.html +++ b/app/admin/view/merchant/system/merchant/margin/list.html @@ -303,7 +303,7 @@ }); - function refundList(data){ + window.refundList=(data)=>{ layui.refundTable = table.render({ elem: '#refund_list', @@ -335,7 +335,7 @@ }, { field: 'mer_name', - title: '商户名称1', + title: '商户名称', align: 'center', width: 200, templet: '
{{d.merchant.mer_name}}
' @@ -410,6 +410,7 @@ ] }); + return layui.refundTable } @@ -456,6 +457,7 @@ //触发事件 var $ = layui.$, active = { + TAGID:'11', tabChange: function(){ //切换到指定Tab项 // element.tabChange('demo', this.getAttribute('lay-id')); //切换tab @@ -527,8 +529,10 @@ var othis = $(this), type = othis.data('type'); active[type] ? active[type].call(this, othis) : ''; if ('11'==this.getAttribute('lay-id')) { + active.TAGID = '11'; active['reload'] ? active['reload'].call(this, othis) : ''; }else{ + active.TAGID = '22'; // refundList() // active['refund_reload'] ? active['refund_reload'].call(this, othis) : ''; } @@ -537,28 +541,40 @@ //监听button提交 form.on('submit(searchform)', function(data) { - layui.payTable.reload({ - where: { - ...data.field - }, - page: { - curr: 1 - } - }); + if ('11' == active.TAGID) { + layui.payTable.reload({ + where: { + ...data.field + }, + page: { + curr: 1 + } + }); + }else{ + refundList(data.field) + } + return false; }); // 监听select 提交 form.on('select(searchform)', function(e) { let data = getformdata(); - layui.payTable.reload({ - where: { - ...data - }, - page: { - curr: 1 - } - }); + + if ('11' == active.TAGID) { + active['reload'] ? active['reload'].call(this, othis) : ''; + // layui.payTable.reload({ + // where: { + // ...data + // }, + // page: { + // curr: 1 + // } + // }); + }else{ + active['refund_reload'] ? active['refund_reload'].call(this, othis) : ''; + } + return false; }); diff --git a/app/common/model/merchant/system/financial/Financial.php b/app/common/model/merchant/system/financial/Financial.php index 49bd57e..c6ca38a 100644 --- a/app/common/model/merchant/system/financial/Financial.php +++ b/app/common/model/merchant/system/financial/Financial.php @@ -134,7 +134,8 @@ class Financial extends Model $query->where('is_del',0); }); - $query->when(isset($where['status']) && $where['status'] !=='',function($query) use($where){ + $query->when(isset($where['status']) && $where['status'] !=='', + function($query) use($where){ $query->where('Financial.status',$where['status']); }) ->when(isset($where['financial_type']) && $where['financial_type'] !=='',function($query) use($where){