Commit 285f6f36 authored by 董先生's avatar 董先生

提现核销

parent b7798349
...@@ -396,6 +396,7 @@ class Withdraw extends Backend ...@@ -396,6 +396,7 @@ class Withdraw extends Backend
try { try {
$params['status'] = $status; $params['status'] = $status;
$params['end_time'] = time();
$row->where(['id' => $id])->update($params); $row->where(['id' => $id])->update($params);
Db::commit(); Db::commit();
} catch (ValidateException | PDOException | Exception $e) { } catch (ValidateException | PDOException | Exception $e) {
...@@ -406,4 +407,30 @@ class Withdraw extends Backend ...@@ -406,4 +407,30 @@ class Withdraw extends Backend
} }
/**
* 核销提现
*/
public function batchVerification($ids= '')
{
/* $ip = request()->ip();
$admin_id = get_admin_id();
if (!in_array($ip, ['183.217.150.48']) && $admin_id != 1) {
$this->error('非管理员禁止审核提现');
}*/
if($ids){
$row = $this->model->where(['status'=>0,'id' =>['in',explode(',',$ids)]])->select();
}else{
$this->error(__('请批量勾选'));
// $row = $this->model->where(['status' =>0])->select();
}
foreach ($row as $key => $val){
$params['status'] = 2;
$params['end_time'] = time();
$row->where(['id' => $val['id']])->update($params);
}
$this->success("核销成功");
}
} }
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</span> </span>
</a> </a>
<a href="javascript:;" id="batchaudit" class="btn btn-info default" title="{:__('批量审核通过')}" ><i class="fa"></i> {:__('批量审核通过')}</a> <a href="javascript:;" id="batchaudit" class="btn btn-info default" title="{:__('批量审核通过')}" ><i class="fa"></i> {:__('批量审核通过')}</a>
<a href="javascript:;" id="batchverification" class="btn btn-info default" title="{:__('批量核销')}" ><i class="fa"></i> {:__('批量审核通过')}</a>
<div class="dropdown btn-group {:$auth->check('users/withdraw/multi')?'':'hide'}"> <div class="dropdown btn-group {:$auth->check('users/withdraw/multi')?'':'hide'}">
<!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>--> <!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>-->
<ul class="dropdown-menu text-left" role="menu"> <ul class="dropdown-menu text-left" role="menu">
......
...@@ -386,6 +386,9 @@ class Users extends Api ...@@ -386,6 +386,9 @@ class Users extends Api
case 1: case 1:
$val['state'] = '已通过'; $val['state'] = '已通过';
break; break;
case 2:
$val['state'] = '已核销';
break;
} }
} }
$this->success('获取成功', ['total_money' => $usersinfo['total_money'], 'withdraws' => $Withdraws]); $this->success('获取成功', ['total_money' => $usersinfo['total_money'], 'withdraws' => $Withdraws]);
......
...@@ -41,7 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ...@@ -41,7 +41,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'money', title: __('Money')}, {field: 'money', title: __('Money')},
{field: 'serve_money', title: __('Serve_money')}, {field: 'serve_money', title: __('Serve_money')},
{field: 'remark', title: __('拒绝理由')}, {field: 'remark', title: __('拒绝理由')},
{field: 'status', title: __('Status'), searchList: {"-1":__('Status -1'),"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'status', title: __('Status'), searchList: {"-1":__('Status -1'),"0":__('Status 0'),"1":__('Status 1'),"2":__('Status ')}, formatter: Table.api.formatter.status},
{field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'withdraw_way', title: __('Withdraw_way'), searchList: {"1":__('Withdraw_way 1'),"2":__('Withdraw_way 2')}, formatter: Table.api.formatter.normal}, {field: 'withdraw_way', title: __('Withdraw_way'), searchList: {"1":__('Withdraw_way 1'),"2":__('Withdraw_way 2')}, formatter: Table.api.formatter.normal},
...@@ -111,6 +111,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ...@@ -111,6 +111,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
} }
}) })
}); });
$('#batchverification').click(function () {
var data= table.bootstrapTable('getSelections');
var id_str = '';
for(var i = 0; i < data.length; i++){
id_str += data[i].id + ',';
}
id_str = id_str.substr(0,id_str.length-1);
console.log(id_str);
$.get('users/withdraw/batchverification',{ids:id_str},function (res) {
if(res.code == 1){
layer.alert('批量核销成功');
}else {
layer.alert(res.msg);
}
})
});
// 为表格绑定事件 // 为表格绑定事件
Table.api.bindevent(table); Table.api.bindevent(table);
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment