退回保证金bug
This commit is contained in:
parent
a6ac4a34e2
commit
3f9fb63437
@ -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)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,6 @@
|
||||
<td colspan="6">
|
||||
<input type="text" name="mer_name" lay-verify="required"
|
||||
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>
|
||||
</tr>
|
||||
|
||||
|
@ -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: '<div>{{d.merchant.mer_name}}</div>'
|
||||
@ -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;
|
||||
});
|
||||
|
||||
|
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user