退回保证金bug

This commit is contained in:
liuxiaoquan 2023-03-17 01:01:19 +08:00
parent a6ac4a34e2
commit 3f9fb63437
4 changed files with 79 additions and 73 deletions

View File

@ -14,10 +14,14 @@ use think\App;
use think\Request; use think\Request;
use app\admin\BaseController; use app\admin\BaseController;
use app\common\model\merchant\system\financial\Financial as FinancialModel; use app\common\model\merchant\system\financial\Financial as FinancialModel;
use think\facade\View;
class Financial extends BaseController class Financial extends BaseController
{ {
protected $model; protected $model;
protected $path = [
];
public function __construct(App $app, FinancialModel $model) public function __construct(App $app, FinancialModel $model)
{ {
@ -26,6 +30,23 @@ class Financial extends BaseController
$this->model = $model; $this->model = $model;
} }
/**
* 备注表单页
*/
public function markForm()
{
return View();
}
/**
* 审核表单页
*/
public function statusForm()
{
return View();
}
/** /**
* 余额退还记录 * 余额退还记录
*/ */
@ -63,68 +84,38 @@ class Financial extends BaseController
/** /**
* 显示创建资源表单页. * 退回保证金审核
* *
* @return \think\Response * @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)
{
//
}
} }

View File

@ -21,8 +21,6 @@
<td colspan="6"> <td colspan="6">
<input type="text" name="mer_name" lay-verify="required" <input type="text" name="mer_name" lay-verify="required"
lay-reqText="商户名称" disabled autocomplete="off" placeholder="商户名称" class="layui-input" value="{$data.mer_name}"> lay-reqText="商户名称" disabled autocomplete="off" placeholder="商户名称" class="layui-input" value="{$data.mer_name}">
<!-- <input type="text" name="type" lay-verify="required"
lay-reqText="明细类型" hidden= autocomplete="off" placeholder="明细类型" class="layui-input" value="{$data.type}"> -->
</td> </td>
</tr> </tr>

View File

@ -303,7 +303,7 @@
}); });
function refundList(data){ window.refundList=(data)=>{
layui.refundTable = table.render({ layui.refundTable = table.render({
elem: '#refund_list', elem: '#refund_list',
@ -335,7 +335,7 @@
}, },
{ {
field: 'mer_name', field: 'mer_name',
title: '商户名称1', title: '商户名称',
align: 'center', align: 'center',
width: 200, width: 200,
templet: '<div>{{d.merchant.mer_name}}</div>' templet: '<div>{{d.merchant.mer_name}}</div>'
@ -410,6 +410,7 @@
] ]
}); });
return layui.refundTable
} }
@ -456,6 +457,7 @@
//触发事件 //触发事件
var $ = layui.$, active = { var $ = layui.$, active = {
TAGID:'11',
tabChange: function(){ tabChange: function(){
//切换到指定Tab项 //切换到指定Tab项
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab // element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
@ -527,8 +529,10 @@
var othis = $(this), type = othis.data('type'); var othis = $(this), type = othis.data('type');
active[type] ? active[type].call(this, othis) : ''; active[type] ? active[type].call(this, othis) : '';
if ('11'==this.getAttribute('lay-id')) { if ('11'==this.getAttribute('lay-id')) {
active.TAGID = '11';
active['reload'] ? active['reload'].call(this, othis) : ''; active['reload'] ? active['reload'].call(this, othis) : '';
}else{ }else{
active.TAGID = '22';
// refundList() // refundList()
// active['refund_reload'] ? active['refund_reload'].call(this, othis) : ''; // active['refund_reload'] ? active['refund_reload'].call(this, othis) : '';
} }
@ -537,28 +541,40 @@
//监听button提交 //监听button提交
form.on('submit(searchform)', function(data) { form.on('submit(searchform)', function(data) {
layui.payTable.reload({ if ('11' == active.TAGID) {
where: { layui.payTable.reload({
...data.field where: {
}, ...data.field
page: { },
curr: 1 page: {
} curr: 1
}); }
});
}else{
refundList(data.field)
}
return false; return false;
}); });
// 监听select 提交 // 监听select 提交
form.on('select(searchform)', function(e) { form.on('select(searchform)', function(e) {
let data = getformdata(); let data = getformdata();
layui.payTable.reload({
where: { if ('11' == active.TAGID) {
...data active['reload'] ? active['reload'].call(this, othis) : '';
}, // layui.payTable.reload({
page: { // where: {
curr: 1 // ...data
} // },
}); // page: {
// curr: 1
// }
// });
}else{
active['refund_reload'] ? active['refund_reload'].call(this, othis) : '';
}
return false; return false;
}); });

View File

@ -134,7 +134,8 @@ class Financial extends Model
$query->where('is_del',0); $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']); $query->where('Financial.status',$where['status']);
}) })
->when(isset($where['financial_type']) && $where['financial_type'] !=='',function($query) use($where){ ->when(isset($where['financial_type']) && $where['financial_type'] !=='',function($query) use($where){