修改推廣員bug

master
ELF 5 years ago
parent 947c58952b
commit 9ca131aaaa

@ -3066,7 +3066,7 @@ class DownloadController extends BaseController {
$pages = ceil($accessNum / $perSize); $pages = ceil($accessNum / $perSize);
for($i = 1; $i <= $pages; $i++) { for($i = 1; $i <= $pages; $i++) {
$data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') $data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id')
->where($map) ->where($map)
->order('id desc') ->order('id desc')
->limit(($i-1)*$perSize ,$perSize) ->limit(($i-1)*$perSize ,$perSize)
@ -3084,6 +3084,14 @@ class DownloadController extends BaseController {
->where(array('id' => ['in',$withdrawIds])) ->where(array('id' => ['in',$withdrawIds]))
->getField('id,status'); ->getField('id,status');
$promotes = [];
$promoteService = new PromoteService();
if (count($data) > 0) {
$promoteIds = array_column($data, 'promote_id');
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select();
$promotes = index_by_column('id', $promotes);
}
foreach ($data as &$list) { foreach ($data as &$list) {
//提现状态 //提现状态
$list['pay_order_number'] = $this->encryption($list['pay_order_number']); $list['pay_order_number'] = $this->encryption($list['pay_order_number']);
@ -3115,11 +3123,12 @@ class DownloadController extends BaseController {
$list['pay_amount_nei'] = 0; $list['pay_amount_nei'] = 0;
} }
$promoteGroup = isset($promotes[$list['promote_id']]) ? $promoteService->getGroupNameByChain($promotes[$list['promote_id']]['chain'], $list['promote_id']) : '';
$csvData["pay_order_number"] = $list["pay_order_number"]; $csvData["pay_order_number"] = $list["pay_order_number"];
$csvData["game_name"] = $list["game_name"]; $csvData["game_name"] = $list["game_name"];
$csvData["user_account"] = $list["user_account"]; $csvData["user_account"] = $list["user_account"];
$csvData["promote_account"] = $list["promote_account"]; $csvData["promote_account"] = $list["promote_account"] . ($promoteGroup == '' ? '' : '(' . $promoteGroup . ')');
$csvData["pay_amount"] = $list["pay_amount"]; $csvData["pay_amount"] = $list["pay_amount"];
$csvData["pay_amount_zhi"] = $list["pay_amount_zhi"]; $csvData["pay_amount_zhi"] = $list["pay_amount_zhi"];
$csvData["pay_amount_nei"] = $list["pay_amount_nei"]; $csvData["pay_amount_nei"] = $list["pay_amount_nei"];
@ -3620,10 +3629,12 @@ class DownloadController extends BaseController {
->limit(($i-1)*$perSize ,$perSize) ->limit(($i-1)*$perSize ,$perSize)
->select(); ->select();
$promoteService = new PromoteService(); if (count($data) > 0) {
$promoteIds = array_column($data, 'promote_id'); $promoteService = new PromoteService();
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); $promoteIds = array_column($data, 'promote_id');
$promotes = index_by_column('id', $promotes); $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select();
$promotes = index_by_column('id', $promotes);
}
foreach($data as $key => $value) { foreach($data as $key => $value) {
// if (empty($value['user_account']) ) { // if (empty($value['user_account']) ) {

@ -293,10 +293,13 @@ class FinanceController extends BaseController
->where(array('id' => ['in', $withdrawIds])) ->where(array('id' => ['in', $withdrawIds]))
->getField('id,status'); ->getField('id,status');
$promotes = [];
$promoteService = new PromoteService(); $promoteService = new PromoteService();
$promoteIds = array_column($data, 'promote_id'); if (count($data) > 0) {
$promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); $promoteIds = array_column($data, 'promote_id');
$promotes = index_by_column('id', $promotes); $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select();
$promotes = index_by_column('id', $promotes);
}
foreach ($data as &$list) { foreach ($data as &$list) {
//提现状态 //提现状态

@ -121,11 +121,14 @@
var promote_type = $('[name=promote_type]').val(); var promote_type = $('[name=promote_type]').val();
var repassword = $('#repassword').val(); var repassword = $('#repassword').val();
var parent_id = $('#parent_id').val(); var parent_id = $('#parent_id').val();
var group_remark = $('#group_remark').val();
if (group_remark === undefined) {
group_remark = '';
}
if ($('#parent_id').length > 0 && parent_id == 0) { if ($('#parent_id').length > 0 && parent_id == 0) {
layer.msg('请选择所属上级'); layer.msg('请选择所属上级');
return return
} }
console.log(promote_type)
$.ajax({ $.ajax({
type:"POST", type:"POST",
url:"{:U('addPromote')}", url:"{:U('addPromote')}",
@ -139,6 +142,7 @@
mobile_phone: mobile_phone, mobile_phone: mobile_phone,
idcard: idcard, idcard: idcard,
nickname: nickname, nickname: nickname,
group_remark: group_remark,
}, },
success:function(res){ success:function(res){
if(res.status == 1){ if(res.status == 1){
@ -181,7 +185,8 @@
if($('#repassword').val()!==$('#password').val()){ if($('#repassword').val()!==$('#password').val()){
return json_data = {'status':0,'msg':'子渠道密码和确认密码不一致'} return json_data = {'status':0,'msg':'子渠道密码和确认密码不一致'}
} }
if ((promote_type == 0 || promote_type == 1) && $.trim($('#group_remark')) == '') { var promote_type = parseInt($('[name=promote_type]').val());
if ((promote_type == 0 || promote_type == 1) && $.trim($('#group_remark').val()) == '') {
if (promote_type == 0) { if (promote_type == 0) {
return json_data = {'status':0,'msg':'请输入部门名称'} return json_data = {'status':0,'msg':'请输入部门名称'}
} }

Loading…
Cancel
Save