|
|
|
@ -129,6 +129,7 @@ class QueryController extends ThinkController
|
|
|
|
|
$withdrawNumber = I('widthdraw_number', '');
|
|
|
|
|
$status = intval(I('status', ''));
|
|
|
|
|
$opType = intval(I('op_type', 0));
|
|
|
|
|
$settlementType = intval(I('settlement_type', 0));
|
|
|
|
|
if ($createTime) {
|
|
|
|
|
$createTimeEnd = $createTime + 3600 * 24 - 1;
|
|
|
|
|
$map['create_time'] = ['between', [$createTime, $createTimeEnd]];
|
|
|
|
@ -145,8 +146,11 @@ class QueryController extends ThinkController
|
|
|
|
|
if ($opType) {
|
|
|
|
|
$map['op_type'] = $opType;
|
|
|
|
|
}
|
|
|
|
|
if ($settlementType) {
|
|
|
|
|
$map['settlement_type'] = $settlementType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$records = M('withdraw', 'tab_')->field('id, promote_account, widthdraw_number, sum_money, op_id, op_type, last_op_id, last_op_type, settlement_begin_time, settlement_end_time, create_time, status, respond')
|
|
|
|
|
$records = M('withdraw', 'tab_')->field('id, promote_account, widthdraw_number, sum_money, op_id, op_type, last_op_id, last_op_type, settlement_begin_time, settlement_end_time, create_time, status, respond, settlement_type')
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('create_time desc')
|
|
|
|
|
->page($page, $row)
|
|
|
|
@ -862,6 +866,7 @@ class QueryController extends ThinkController
|
|
|
|
|
|
|
|
|
|
public function withdraw()
|
|
|
|
|
{
|
|
|
|
|
$page = I('p', 1);
|
|
|
|
|
$adminid = C('USER_ADMINISTRATOR');//获取超管id
|
|
|
|
|
$adminmobile = M('UcenterMember')->field('mobile')->find($adminid);
|
|
|
|
|
$this->assign('adminmobile', $adminmobile['mobile']);
|
|
|
|
@ -874,6 +879,9 @@ class QueryController extends ThinkController
|
|
|
|
|
if (isset($_REQUEST['op_type'])) {
|
|
|
|
|
$map['op_type'] = $_REQUEST['op_type'];
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['settlement_type'])) {
|
|
|
|
|
$map['settlement_type'] = $_REQUEST['settlement_type'];
|
|
|
|
|
}
|
|
|
|
|
if (isset($_REQUEST['promote_account'])) {
|
|
|
|
|
if ($_REQUEST['promote_account'] == '全部') {
|
|
|
|
|
unset($_REQUEST['promote_account']);
|
|
|
|
@ -920,8 +928,43 @@ class QueryController extends ThinkController
|
|
|
|
|
//为数据权限添加
|
|
|
|
|
setPowerPromoteIds($map);
|
|
|
|
|
$this->assign('is_admin', is_administrator());
|
|
|
|
|
$user->money_list($model, $p, $map);
|
|
|
|
|
$user->money_list($model, $page, $map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getWithdraw()
|
|
|
|
|
{
|
|
|
|
|
$promoteId = intval(I('post.promote_id', 0));
|
|
|
|
|
$beginTime = I('post.begin_time', '');
|
|
|
|
|
$endTime = I('post.end_time', '');
|
|
|
|
|
$msg = '';
|
|
|
|
|
|
|
|
|
|
if (empty($promoteId) || empty($beginTime) || empty($endTime)) {
|
|
|
|
|
$this->ajaxReturn(['msg' => $msg]);
|
|
|
|
|
}
|
|
|
|
|
$beginTime = strtotime($beginTime);
|
|
|
|
|
$endTime = strtotime($endTime) + 3600 * 24 - 1;
|
|
|
|
|
|
|
|
|
|
$map['promote_id'] = $promoteId;
|
|
|
|
|
$map['settlement_end_time'] = ['between', [$beginTime, $endTime]];
|
|
|
|
|
$map['status'] = ['neq', -2];
|
|
|
|
|
|
|
|
|
|
$withdraws = D('withdraw')->field('id, settlement_begin_time, settlement_end_time')
|
|
|
|
|
->where($map)
|
|
|
|
|
->select();
|
|
|
|
|
if (!empty($withdraws)) {
|
|
|
|
|
foreach ($withdraws as $withdraw) {
|
|
|
|
|
$settlementEndTime = date('Y-m-d', $withdraw['settlement_end_time'] + 1);
|
|
|
|
|
if ($withdraw['settlement_begin_time'] > 0) {
|
|
|
|
|
$settlementBeginTime = date('Y-m-d', $withdraw['settlement_begin_time']);
|
|
|
|
|
$msg .= "{$settlementBeginTime}至{$settlementEndTime}之间的订单已经提现;";
|
|
|
|
|
} else {
|
|
|
|
|
$msg .= "{$settlementEndTime}之前的订单已经提现;";
|
|
|
|
|
}
|
|
|
|
|
$msg .= '<br>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->ajaxReturn(['msg' => $msg]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function set_withdraw_status()
|
|
|
|
|