Merge pull request '版本更新' () from release into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/285
master
廖金灵
commit 56e28d216e

@ -1512,6 +1512,22 @@ function getMonth() {
return $range;
}
function showMonthRange($start, $end)
{
$end = date('Y-m', strtotime($end)); // 转换为月
$range = [];
$i = 0;
do {
$month = date('Y-m', strtotime($start . ' + ' . $i . ' month'));
//echo $i . ':' . $month . '<br>';
$range[] = $month;
$i++;
} while ($month < $end);
rsort($range);
return $range;
}
function getPayType($type) {
$return = '';

@ -376,16 +376,20 @@ class CompanyStatementSetController extends Controller {
if($type < 2){
//非补点奖罚
$rrmap = array(
"confirm_time" => ['between', [$begintime,$endtime]],
"d.confirm_time" => ['between', [$begintime,$endtime]],
"company_type"=>1,
"company_id"=>$add_data['company_id'],
"settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->alias("d")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count
")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)->find();
if($rfres['reward_count'] > 0){
$reward_count = $rfres['reward_count'];
@ -888,16 +892,19 @@ class CompanyStatementSetController extends Controller {
if($type < 2){
//非补点计算奖罚
$rrmap = array(
"confirm_time" => ['between', [$begintime,$endtime]],
"d.confirm_time" => ['between', [$begintime,$endtime]],
"company_type"=>2,
"company_id"=>$add_data['company_id'],
"settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->alias("d")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward_count,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine_count
")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)->find();
if($rfres['reward_count'] > 0){
$reward_count = $rfres['reward_count'];
@ -2101,6 +2108,7 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>2,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
// "relation_game_id"=>$relation_game_id,
);
@ -2149,6 +2157,7 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>1,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
// "relation_game_id"=>$relation_game_id,
);
@ -2180,12 +2189,14 @@ class CompanyStatementSetController extends Controller {
"d.company_type"=>2,
"d.company_id"=>$cpmpamy_id,
"d.settlement_type"=>2,
"is_verify"=>1,
);
$rfres = M("RewardDetail","tab_")
->alias("d")
->field("
IFNULL(SUM(CASE WHEN type = 1 THEN amount ELSE 0 END),0) as reward,
IFNULL(SUM(CASE WHEN type = 2 THEN amount ELSE 0 END),0) as fine")
->join('tab_reward_record as r on d.record_id = r.id', 'LEFT')
->where($rrmap)
->group("company_id")
->find();

@ -1146,6 +1146,11 @@ class ExportController extends Controller
unset($_REQUEST['is_check']);
}
if (isset($_REQUEST['is_refund'])) {
$map['is_refund'] = (int)($_REQUEST['is_refund']);
unset($_REQUEST['is_refund']);
}
if ($_REQUEST['merchant_id']) {
$map['merchant_id'] = $_REQUEST['merchant_id'];
unset($_REQUEST['merchant_id']);
@ -1236,6 +1241,7 @@ class ExportController extends Controller
'pay_amount' => '实付金额',
'pay_way' => '充值方式',
'pay_status' => L('Order_status'),
'is_refund' => '退款状态',
'pay_game_status' => '游戏通知状态',
'is_check' => '是否参与结算',
'promote_id' => "消费"."{$total}",
@ -1314,6 +1320,7 @@ class ExportController extends Controller
$value['game_id'] = $thisGameInfo['partner_name'];
$value['is_check'] = D("Spend")::IsCheckStr[$value['is_check']];
$value['is_refund'] = D("Spend")::IsRefundStr[$value['is_refund']];
$value['company_name'] = $promoters[$value['promote_id']] == 0 ? '官方渠道' : ($companys[$promoters[$value['promote_id']]] ?? '');
unset($value['promote_id']);

@ -757,12 +757,18 @@ class MarketPercentageController extends ThinkController
continue;
}
}
// if ($value['admin_id'] == 27) {
// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']));
// }
// dump($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']));
//离职结算判断
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['achievement_bonus']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_achievement_commission']='0.00'):'';
if ($this->unSettlementList[$value['admin_id']]&&date("Y-m",$this->unSettlementList[$value['admin_id']])<=$value['pay_time']) {
$data[$key]['leave_time'] = date("Y-m-d",$this->unSettlementList[$value['admin_id']]);
}
@ -834,6 +840,9 @@ class MarketPercentageController extends ThinkController
$data[$key]['extend_commission'] = number_format($data[$key]['extend_commission'], 2, '.', '');
$data[$key]['should_month_bonus_ratio'] = $data[$key]['extend_commission'] - $data[$key]['should_performance_commission'];
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['should_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['should_month_bonus_ratio']='0.00'):'';
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['performance_commission']);
// dump($this->returnMarketPercentageArray[$value['admin_id'].$value['pay_time']]['achievement_bonus']);
@ -842,11 +851,19 @@ class MarketPercentageController extends ThinkController
$data[$key]['wait_commission'] = number_format($data[$key]['wait_commission'], 2, '.', '');
$data[$key]['wait_achievement_commission'] = $data[$key]['wait_commission'] - $data[$key]['wait_performance_commission'];
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
$data[$key]['achievement_bonus'] = $achievement_bonus;
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['commission']-=$data[$key]['wait_commission']):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_commission']='0.00'):'';
$sum['performance_revenue'] += $data[$key]['performance_revenue'];
$sum['appraisal_bonuses'] += $data[$key]['appraisal_bonuses'];
$sum['performance_commission'] += $data[$key]['performance_commission'];
@ -862,7 +879,7 @@ class MarketPercentageController extends ThinkController
// $sum['wait_achievement_commission'] += $data[$key]['wait_achievement_commission'];
}
// die();
$sum['wait_commission'] = '-------';
$sum['pay_time'] = '总计';
@ -929,34 +946,6 @@ class MarketPercentageController extends ThinkController
$data[$key]['achievement_bonus'] .= ',2)';
}
// if ($value['achievement_profit'] != "0.00") {
// if ($data[$key]['performance_commission'] == "=ROUND(") {
// $data[$key]['performance_commission'] .= "K{$line}*(G{$line}/100),2)";
// } else {
// $data[$key]['performance_commission'] .= "+K{$line}*(G{$line}/100),2)";
// }
//
// if ($data[$key]['achievement_bonus'] == "=ROUND(") {
// $data[$key]['achievement_bonus'] .= "K{$line}*(I{$line}/100),2)";
// } else {
// $data[$key]['achievement_bonus'] .= "+K{$line}*(I{$line}/100),2)";
// }
// } else {
// $data[$key]['performance_commission'] .= ",2)";
// $data[$key]['achievement_bonus'] .= ",2)";
// }
//
// if ($data[$key]['performance_commission'] == '=ROUND(,2)') {
// $data[$key]['performance_commission'] = "0.00";
// }
//
// if ($data[$key]['achievement_bonus'] == '=ROUND(,2)') {
// $data[$key]['achievement_bonus'] = "0.00";
// }
// $data[$key]['performance_commission'] = "=ROUND(J{$line}*(F{$line}/100)+J{$line}*(G{$line}/100),2)";
// $data[$key]['achievement_bonus'] = "=ROUND(J{$line}*(H{$line}/100)+J{$line}*(I{$line}/100),2)";
$data[$key]['commission'] = "=ROUND(L{$line}+M{$line}*N{$line},2)";
}
@ -1130,6 +1119,7 @@ class MarketPercentageController extends ThinkController
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['achievement_bonus']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isSettlement($value['pay_time'],$value['admin_id']))?($value['wait_achievement_commission']='0.00'):'';
@ -1146,6 +1136,15 @@ class MarketPercentageController extends ThinkController
$data[$key]['commission'] = number_format($data[$key]['performance_commission'] + $data[$key]['achievement_bonus'], 2, '.', '');;
$data[$key]['extend_commission'] = $data[$key]['commission'] - $data[$key]['wait_commission'];
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['commission']-=$data[$key]['wait_commission']):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_performance_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_achievement_commission']='0.00'):'';
!($this->leavePercentage->isTimeoutSettlement($value['pay_time'],$value['admin_id']))?($data[$key]['wait_commission']='0.00'):'';
$sum['performance_revenue'] += $value['performance_revenue'];
$sum['appraisal_bonuses'] += $value['appraisal_bonuses'];

@ -139,7 +139,7 @@ class MemberController extends ThinkController
$this->checkListOrCountAuthRestMap($map,["tab_user.id","tab_user.account","tab_user.device_number"]);
//计算用户列表
$data = M("user","tab_")
->field("tab_user.id,`device_number`,`age_status`,tab_user.account,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,
->field("tab_user.id,`device_number`,`device_type`,`age_status`,tab_user.account,`balance`,`gold_coin`,`alipay`,tab_user.promote_id,`register_type`,tab_user.promote_account,`register_time`,`lock_status`,lock_remark,
`register_way`,`register_ip`,`login_time`,`check_status`,IFNULL(ss.pay_amount,0) AS recharge_total,tab_user.is_repeat,promote.admin_id")
->where($map)
->group("tab_user.id")
@ -214,13 +214,14 @@ class MemberController extends ThinkController
$v['lock_status'] = get_info_status($v['lock_status'],4);
$v['check_status'] = $v['check_status']==1 ? "正常" :"拉黑";
$v['is_repeat'] = $v['is_repeat']==1 ? "是" :"否";
$v['device_type'] = $v['device_type'] == 1 ? "安卓" :($v['device_type'] == 2 ? "IOS" :"未知");
$v['market_admin_username'] = isset($adminList[$v['promote_id']]) && $adminList[$v['promote_id']]['admin'] ? $adminList[$v['promote_id']]['admin']['username'] : '无';
}
$field = array(
"id"=>"账号ID","account"=>"玩家账号","promote_account"=>"所属推广员","market_admin_username"=>"所属市场专员","balance"=>"账户平台币","recharge_total"=>"累计充值","gold_coin"=>"金币",
"small_count"=>"小号","vip_level"=>"VIP等级","register_type"=>"注册方式","register_time"=>"注册时间","register_ip"=>"注册IP","login_time"=>"最后登录时间",
"device_number"=>"设备号","is_repeat"=>"去重数据","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态"
"device_number"=>"设备号","device_type"=>"设备类型","is_repeat"=>"去重数据","lock_remark"=>"锁定备注","lock_status"=>"账号状态","check_status"=>"拉黑状态"
);
if ($showMarketAdmin == 0) {
unset($field['market_admin_username']);
@ -739,7 +740,12 @@ class MemberController extends ThinkController
->where($map)
->setField('phone', $_POST['phone']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
// $this->userEditOperationLog($_POST['id']);
addOperationLog(array(
"op_type"=>1,
"key"=>get_user_account($_POST['id']).'的手机号修改为:'.$_POST['phone'],
"url"=>U("Member/edit",array("id"=>$_POST['id'])),
));
$this->ajaxReturn(array("status" => 1, "msg" => "手机修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "手机修改失败"));
@ -761,7 +767,7 @@ class MemberController extends ThinkController
if ($pro !== false) {
addOperationLog(array(
"op_type"=>1,
"key"=>get_user_account($_POST['id']),
"key"=>get_user_account($_POST['id']).'的真实姓名修改为:'.$_POST['real_name'],
"url"=>U("Member/edit",array("id"=>$_POST['id'])),
"menu"=>"用户-玩家组-玩家列表-编辑-真实姓名修改",
));
@ -790,7 +796,11 @@ class MemberController extends ThinkController
->where($map)
->setField('idcard', $_POST['idcard']);
if ($pro !== false) {
$this->userEditOperationLog($_POST['id']);
addOperationLog(array(
"op_type"=>1,
"key"=>get_user_account($_POST['id']).'的身份证号码修改为:'.$_POST['idcard'],
"url"=>U("Member/edit",array("id"=>$_POST['id'])),
));
$this->ajaxReturn(array("status" => 1, "msg" => "身份证号码修改成功"));
} else {
$this->ajaxReturn(array("status" => 0, "msg" => "身份证号码修改失败"));

@ -0,0 +1,99 @@
<?php
namespace Admin\Controller;
class RechargeSumOtherController extends ThinkController
{
public function summation($p = 1)
{
$startDateTime = empty($_REQUEST['timeStart']) ? date('Y-m-d', strtotime('-6 day', time())) : $_REQUEST['timeStart'];
$endDateTime = empty($_REQUEST['timeEnd']) ? date('Y-m-d') : $_REQUEST['timeEnd'];
$_GET['timeStart'] = $startDateTime;
$_GET['timeEnd'] = $endDateTime;
if(!array_key_exists("timeStart",$_REQUEST)){
$this->redirect(ACTION_NAME, array('timeStart' => date('Y-m-d',strtotime('-7 day')),"timeEnd"=>date('Y-m-d')));
}
$total = ['current' => 0, 'sum' => 0];
$map['date'] = array('BETWEEN', array($startDateTime, $endDateTime));
$_REQUEST['game_name'] ? ($map['game_name'] = $_REQUEST['game_name']) :'';
$data = M("recharge_text","tab_")->where($map)->order("date desc")->select();
if (isset($_REQUEST['row'])) {
$row = $_REQUEST['row'];
} else {
$row = 10;
}
foreach ($data as $k => $v) {
$total['sum'] += $v['day_pay'];
}
$count = count($data);
$export_data = $data;
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
$data = array_slice($data, ($p - 1) * $row, $row);
foreach ($data as $k => $v) {
$total['current'] += $v['day_pay'];
}
//判断是否执行导出
if (I('export') == 1) {
//操作日志
$GetData = $_GET;
unset($GetData['xlsname']);
unset($GetData['export']);
addOperationLog(['op_type'=>3,'key'=>getNowDate(),'url'=>U('RechargeSum/summation',$GetData),'menu'=>'充值-游戏订单-充值汇总-导出']);
$this->exportSum($export_data);
}
$this->assign('showPromote', session('user_auth')['show_promote']);
$this->assign('meta_title', "充值汇总");
$this->assign('list_data', $data);
$this->assign('total', $total);
$this->assign('startDate', $startDateTime);
$this->assign('endDate', $endDateTime);
$this->assign("is_admin",is_administrator());
$this->m_title = '充值汇总';
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'RechargeSum/summation', 'status' => 1])->find());
$this->display();
}
public function exportSum($data)
{
$export = A('Export');
$exptitle = $_REQUEST['xlsname'];
$expCellName = array(
array('date', '日期'),
array('from_channel', '渠道来源'),
array('game_name', '游戏名称'),
array('new_person', '新增人数'),
array('active_person', '活跃人数'),
array('new_pay_person', "新增玩家付费"),
array('day_pay', '本日累计'),
);
if (session('user_auth')['show_promote'] == 0) {
foreach ($expCellName as $key => $row) {
if ($row[0] == 'promote_id') {
unset($expCellName[$key]);
break;
}
}
$expCellName = array_values($expCellName);
}
$expTableData = $data;
$export->exportExcel($exptitle, $expCellName, $expTableData);
}
}

@ -8,52 +8,112 @@ use User\Api\UserApi as UserApi;
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
*/
class RefundController extends ThinkController {
public function lists(){
if(isset($_REQUEST['user_account'])){
public function userCount(){
if(!array_key_exists("count_date",$_REQUEST) && !array_key_exists("user_account",$_REQUEST)){
$this->redirect(ACTION_NAME, array('count_date' => date('Y-m')));
}
$page = I('p', 1);
$row = I('row', 10);
if(isset($_REQUEST['user_account'])){
$map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
unset($_REQUEST['user_account']);
}
if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
$map['pay_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
unset($_REQUEST['time-start']);unset($_REQUEST['time-end']);
if(isset($_REQUEST['count_date'])){
$map['pay_time'] = ["BETWEEN",$this->getMonthTimeRange($_REQUEST['count_date'])];
}
if(isset($_REQUEST['game_name'])){
if($_REQUEST['game_name']=='全部'){
unset($_REQUEST['game_name']);
}else{
$map['game_name']=$_REQUEST['game_name'];
unset($_REQUEST['game_name']);
}
//
$model = SM("spend_refund",'tab_');
$data = $model
->where($map)
->group("month,user_id")
->order("month desc,refund_amount desc");
if(isset($_REQUEST['export'])){
$data = $data->field("CONCAT(' ',FROM_UNIXTIME(`pay_time`,'%Y-%m')) as month,user_id,user_account,sum(refund_amount) refund_amount")->select();
data2csv($data,'退款统计',array(
"month"=>"月份",
"user_account"=>"玩家账号",
"refund_amount"=>"退款金额"
));
}
if(isset($_REQUEST['pay_order_number'])){
$map['pay_order_number']=array('like','%'.trim($_REQUEST['pay_order_number']).'%');
unset($_REQUEST['pay_order_number']);
$data = $data->field("FROM_UNIXTIME(`pay_time`,'%Y-%m') as month,user_id,user_account,sum(refund_amount) refund_amount")->page($page, $row)->select();
foreach ($data as $k => &$v) {
$between = $this->getMonthTimeRange($v['month'],true);
$v['jump_url'] = U("Spend/lists",['timestart'=>$between[0],'timeend'=>$between[1],'user_account'=>$v['user_account'],'is_refund'=>1]);
}
if(isset($_REQUEST['pay_status'])){
$map['tui_status']=$_REQUEST['pay_status'];
unset($_REQUEST['pay_status']);
$allcount = $model->where($map)->getField("sum(refund_amount) refund_amount");
$count_sql = $model->field("FROM_UNIXTIME(`pay_time`,'%Y-%m') as month,user_id")->group("month,user_id")->where($map)->select(false);
$count = SM()->table( '('.$count_sql.') a' )->count();
$page = set_pagination($count, $row);
if ($page) {
$this->assign('_page', $page);
}
if(isset($_REQUEST['pay_way'])){
$map['pay_way']=$_REQUEST['pay_way'];
unset($_REQUEST['pay_way']);
$this->assign("allcount",$allcount);
$this->assign("data",$data);
$this->assign("date_count",showMonthRange('2019-09-01',date('Y-m-d',time())));
$this->display();
}
protected function getMonthTimeRange($date,$isdate = false)
{
$start = strtotime( $date . "-1 00:00:00" );
$mdays = date('t', $start);
if($isdate){
return [$date."-1",$date.'-'.$mdays];
}
$model = array(
'm_name' => 'RefundRecord',
'map' => $map,
'order' =>'id desc',
'title' => '退款记录',
'template_list' =>'lists',
);
$total=null_to_0(M('RefundRecord','tab_')->where(['tui_status'=>1])->sum('tui_amount'));
$ttotal=null_to_0(M('RefundRecord','tab_')->where('pay_time'.total(1))->where(array('tui_status'=>1))->sum('tui_amount'));
$ytotal=null_to_0(M('RefundRecord','tab_')->where('pay_time'.total(5))->where(array('tui_status'=>1))->sum('tui_amount'));
$this->assign('total',$total);
$this->assign('ttotal',$ttotal);
$this->assign('ytotal',$ytotal);
$user = A('User','Event');
$user->user_join_($model,$_GET['p']);
$end = strtotime( $date.'-'.$mdays.' 23:59:59');
return [$start,$end];
}
// public function lists(){
// if(isset($_REQUEST['user_account'])){
// $map['user_account']=array('like','%'.trim($_REQUEST['user_account']).'%');
// unset($_REQUEST['user_account']);
// }
// if(isset($_REQUEST['time-start'])&&isset($_REQUEST['time-end'])){
// $map['pay_time'] =array('BETWEEN',array(strtotime($_REQUEST['time-start']),strtotime($_REQUEST['time-end'])+24*60*60-1));
// unset($_REQUEST['time-start']);unset($_REQUEST['time-end']);
// }
// if(isset($_REQUEST['game_name'])){
// if($_REQUEST['game_name']=='全部'){
// unset($_REQUEST['game_name']);
// }else{
// $map['game_name']=$_REQUEST['game_name'];
// unset($_REQUEST['game_name']);
// }
// }
// if(isset($_REQUEST['pay_order_number'])){
// $map['pay_order_number']=array('like','%'.trim($_REQUEST['pay_order_number']).'%');
// unset($_REQUEST['pay_order_number']);
// }
// if(isset($_REQUEST['pay_status'])){
// $map['tui_status']=$_REQUEST['pay_status'];
// unset($_REQUEST['pay_status']);
// }
// if(isset($_REQUEST['pay_way'])){
// $map['pay_way']=$_REQUEST['pay_way'];
// unset($_REQUEST['pay_way']);
// }
// $model = array(
// 'm_name' => 'RefundRecord',
// 'map' => $map,
// 'order' =>'id desc',
// 'title' => '退款记录',
// 'template_list' =>'lists',
// );
// $total=null_to_0(M('RefundRecord','tab_')->where(['tui_status'=>1])->sum('tui_amount'));
// $ttotal=null_to_0(M('RefundRecord','tab_')->where('pay_time'.total(1))->where(array('tui_status'=>1))->sum('tui_amount'));
// $ytotal=null_to_0(M('RefundRecord','tab_')->where('pay_time'.total(5))->where(array('tui_status'=>1))->sum('tui_amount'));
// $this->assign('total',$total);
// $this->assign('ttotal',$ttotal);
// $this->assign('ytotal',$ytotal);
// $user = A('User','Event');
// $user->user_join_($model,$_GET['p']);
// }
}

@ -29,6 +29,10 @@ class SpendController extends ThinkController
$map['is_check'] = (int)($_REQUEST['is_check']);
}
if (isset($_REQUEST['is_refund'])) {
$map['is_refund'] = (int)($_REQUEST['is_refund']);
}
if (isset($_REQUEST['user_account'])) {
$map['user_account'] = array('like', trim($_REQUEST['user_account']));
unset($_REQUEST['user_account']);
@ -147,6 +151,7 @@ class SpendController extends ThinkController
($value['promote_account']=='官方渠道')?($value['promote_account']=C('OFFICIEL_CHANNEL')):'';
$value['market_admin_username'] = $adminUsernameList[$value['market_admin_id']] ?? '无';
$value['is_check_str'] = D(self::model_name)::IsCheckStr[$value['is_check']];
$value['is_refund_str'] = D(self::model_name)::IsRefundStr[$value['is_refund']];
//拆分游戏名称和设备类型
$game_arr = explode("(", rtrim($value['game_name'], ")"));
$value['game_name'] = $game_arr[0];
@ -178,6 +183,8 @@ class SpendController extends ThinkController
$mentBtn = [
"addStatement"=>"<a class='butn' id='addStatement'>参与结算</a>",
"removeStatement"=>"<a class='butn' id='removeStatement' style='background-color: red;'>移出结算</a>",
"addRefund"=>"<a class='butn' id='addRefund'>登记退款</a>",
"removeRefund"=>"<a class='butn' id='removeRefund' style='background-color: red;'>取消退款</a>",
];
$resarr = [];
foreach ($mentBtn as $k => $v) {
@ -191,7 +198,7 @@ class SpendController extends ThinkController
}
return $resarr;
}
//是否结算
public function addStatement()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
@ -232,4 +239,51 @@ class SpendController extends ThinkController
addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,"content"=>json_encode(["ids"=>$_REQUEST['ids'],"is_check"=>$newval])]);
return true;
}
//是否退款
public function addRefund()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIsrefund($ids,0,1);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
public function removeRefund()
{
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
$ids = $_REQUEST['ids'];
$this->editOrderIsrefund($ids,1,0);
$this->ajaxReturn(array(
'status' => 1,
"info"=>"操作成功"
));
}
protected function editOrderIsrefund($ids,$oldval,$newval){
$time = time();
$dbres = D(self::model_name)->field("id as s_id,user_id,user_account,pay_amount as refund_amount,pay_time,{$time} as create_time")->where("id in ({$ids}) and is_refund = '{$oldval}' and pay_status = 1")->select();
if(empty($dbres)) return false;
$changeIds = implode(",",array_column($dbres,"s_id"));
//执行操作
$res = D(self::model_name)->where("id in ({$changeIds}) and is_refund = '{$oldval}'")->save(['is_refund'=>$newval]);
if(empty($res)) return false;
//日志
if($newval == 1){
$op_name = "登记退款";
$key = "addRefund";
SM('spend_refund',"tab_")->addAll($dbres);
}else{
$op_name = "取消退款";
$key = "removeRefund";
SM('spend_refund',"tab_")->where("s_id in ({$changeIds}) ")->delete();
}
addOperationLog(['op_type'=>1,'key'=>$key,"op_name"=>$op_name,"content"=>json_encode(["ids"=>$_REQUEST['ids'],"is_refund"=>$newval])]);
return true;
}
}

@ -346,7 +346,7 @@ class StatementMangementController extends ThinkController
$list = SM('reward_record', 'tab_')->alias('r')
->field('
r.id, r.relation_game_id, r.settlement_time, r.confirm_time, r.content, r.reward_type, r.creater_id,
r.id, r.relation_game_id, r.settlement_time, r.confirm_time, r.content, r.reward_type, r.creater_id,is_verify,verify_detail,
rd.id as rid, rd.type as detail_type, rd.company_type as detail_company_type, rd.company_id as detail_company_id , rd.company_name as detail_company_name, rd.settlement_type as detail_settlement_type, rd.promote_account as detail_promote_account,rd.amount as detail_amount
')
->where($map)
@ -356,7 +356,16 @@ class StatementMangementController extends ThinkController
if ($list) {
$record = [];
foreach ($list as $item) {
$item["verify_detail"] = json_decode($item["verify_detail"],true);
if($item["is_verify"] == 0) {
$verify_detail = "未审核";
} elseif($item["is_verify"] == 1) {
$verify_detail="审核通过<br>"."(".$item["verify_detail"]["user"].")<br>".$item["verify_detail"]["time"];
} else{
$verify_detail="审核拒绝<br>"."(".$item["verify_detail"]["user"].")<br>".$item["verify_detail"]["time"];
}
if (!isset($record[$item['id']]))
{
$record[$item['id']] = [
@ -370,7 +379,9 @@ class StatementMangementController extends ThinkController
'maxCount' => 0,
'creater_id' => $item['creater_id'],
'totalReward' => 0,
'totalPunish' => 0
'totalPunish' => 0,
'is_verify'=>$item['is_verify'],
'verify'=>$verify_detail
];
}
if (!empty($item['rid'])) {
@ -558,6 +569,8 @@ class StatementMangementController extends ThinkController
$ins = SM('reward_record', 'tab_')->add($data);
$record_id = SM('reward_record', 'tab_')->getLastInsID();
$this->autoVerify($settlmentSet,$record_id);
foreach ($settlmentSet as $item) {
$item['record_id'] = $record_id;
SM('reward_detail', 'tab_')->add($item);
@ -1474,4 +1487,89 @@ class StatementMangementController extends ThinkController
}
//审核
public function verify() {
$id = $_REQUEST["id"];
$status = $_REQUEST["status"];
if (!isset($id)||!isset($status)) {
$this->ajaxReturn(["status"=>0,"msg"=>"参数错误"]);
}
if($status != 2) {
$data = SM("reward_record","tab_")
->field("is_verify,company_id,company_belong")
->join("left join tab_reward_detail on record_id=tab_reward_record.id")
->join("left join tab_promote_company on tab_promote_company.id=tab_reward_detail.company_id")
->where(["tab_reward_record.id"=>['in',$id]])
->select();
foreach ($data as $key => $value) {
if ($value['is_verify'] != 0) {
$this->ajaxReturn(["status"=>0,"msg"=>"含有已审核无需重新审核"]);
}
}
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
$is_success = SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>$status,"verify_detail"=>$detail]);
if ($is_success) {
$this->ajaxReturn(["status"=>1,"msg"=>"操作成功"]);
} else {
$this->ajaxReturn(["status"=>1,"msg"=>"操作失败"]);
}
} else {
$data = SM("reward_record","tab_")
->field("is_verify,company_id,company_belong")
->join("left join tab_reward_detail on record_id=tab_reward_record.id")
->join("left join tab_promote_company on tab_promote_company.id=tab_reward_detail.company_id")
->where(["tab_reward_record.id"=>['in',$id]])
->select();
foreach ($data as $key => $value) {
if ($value['is_verify'] == 0) {
$this->ajaxReturn(["status"=>0,"msg"=>"含有未审核无需撤回审核"]);
}
}
$is_success = SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>0,"verify_detail"=>'']);
if ($is_success) {
$this->ajaxReturn(["status"=>1,"msg"=>"操作成功"]);
} else {
$this->ajaxReturn(["status"=>1,"msg"=>"操作失败"]);
}
}
}
//自动审核通过
public function autoVerify($settlmentSet = [],$id = 0) {
if (!$id) {
return false;
}
$i = 0;
$count = count($settlmentSet);
foreach ($settlmentSet as $key => $value) {
if ($value['company_id']) {
$data = SM("promote_company","tab_")->where(["id"=>$value['company_id']])->find();
if (in_array($data["company_belong"],[0,3])) {
$i++;
}
}
}
if ($i == $count) {
$detail = json_encode(["user"=>$_SESSION['onethink_admin']['user_auth']['username'],"time"=>date("Y-m-d H:i:s",time())]);
SM("reward_record","tab_")->where(["id"=>['in',$id]])->save(["is_verify"=>1,"verify_detail"=>$detail]);
}
}
}

@ -26,6 +26,10 @@ class SpendModel extends Model
"1"=>"是",
"2"=>"否"
];
const IsRefundStr=[
"0"=>"--",
"1"=>"已退款"
];
/* 自动完成规则 */
protected $_auto = array(

@ -154,7 +154,7 @@
<td >
<!-- {$com['statement_info'][0]['refund']|default=0}-->
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="refund" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -183,8 +183,8 @@
<td rowspan="{$com['statement_info'][0]['row']}">{$com['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -237,7 +237,7 @@
<td>{$it['pay_amount']}</td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="refund" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -266,8 +266,8 @@
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td rowspan="{$it['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -391,6 +391,19 @@
// });
// })
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d*)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
var pool_ids = "{$_GET['id']}";
$(".split_RewardOrFail").on("click",function() {
@ -535,12 +548,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -576,7 +601,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -138,7 +138,7 @@
<td><span class="pay_amount">{$com['statement_info'][0]['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="refund" value="{$com['statement_info'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -172,8 +172,8 @@
<td rowspan="{$com['statement_info'][0]['row']}">{$com['statement_info'][0]['reward']-0}</td>
<td rowspan="{$com['statement_info'][0]['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_name']}{$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -226,7 +226,7 @@
<td><span class="pay_amount">{$it['pay_amount']}</span></td>
<td>
<if condition="($com.is_reward_fine_split eq 0)">
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="refund" value="{$it['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<else/>
0
</if>
@ -261,8 +261,8 @@
<td rowspan="{$it['row']}">{$it['reward']-0}</td>
<td rowspan="{$it['row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$it['withhold']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$it['game_name']}{$it['time']?$it['time']:$com['statement_info'][0]['time']}]">
<input class="oldwithhold" value="{$it['withhold']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -361,6 +361,20 @@
});
});
</if>
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d*)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
// $(".no_statement").on("click",function(){
// var id = $(this).data('id');
// $.ajax({
@ -528,12 +542,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -569,7 +595,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -197,8 +197,8 @@
<td rowspan="{$com['statement_info'][0]['time_row']}">{$com['statement_info'][0]['game_list'][0]['fine']||default="0"}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<input class="withhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<else/>
0
</if>
@ -343,8 +343,8 @@
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">
<if condition="($com.is_reward_fine_split eq 0)">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<else/>
0
</if>
@ -464,9 +464,14 @@
saveForm(id);
});
$(".refund").keyup(function() {
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d+)?$/g;
var reg = /^(\-|\+)?\d+(\.\d*)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
@ -610,12 +615,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();

@ -168,7 +168,7 @@
<td><span class="pay_amount">{$com['statement_info'][0]['game_list'][0]['pay_amount']}</span></td>
<td>
<!-- {$com['statement_info'][0]['game_list'][0]['refund']|default=0}-->
<input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
<input class="refund" value="{$com['statement_info'][0]['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]">
</td>
<td>{$com['statement_info'][0]['game_list'][0]['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$com['statement_info'][0]['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
@ -179,8 +179,8 @@
<td rowspan="{$com.row}">{$com['fine']}</td>
<td rowspan="{$com['statement_info'][0]['time_row']}">
<!-- {$com['statement_info'][0]['game_list'][0]['withhold']|default=0}-->
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
<input class="withhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$com['statement_info'][0]['game_list'][0]['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}][{$com['statement_info'][0]['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$com['statement_info'][0]['withhold_amount']|default=0}" style="width: 40px;display: none" >
</td>
<td rowspan="{$com['statement_info'][0]['time_row']}"><span class="week_amount">{$com['statement_info'][0]['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$com['statement_info'][0]['week_amount']}"></td>
<td rowspan="{$com.row}" data-st="{$com['st']}" class="statement_money">{$com['statement_money']}</td>
@ -233,7 +233,7 @@
<td>{$game['game_type_name']}</td>
<!-- <td>{$game['statement_begin_time']}-{$game['statement_end_time']}</td>-->
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td><input class="refund" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]"></td>
<td>{$game['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td><span class="sum_money_span">{$game['sum_money']}</span><input class="sum_money" name="sum_money[{$com['id']}][{$game['game_name']}{$com['statement_info'][0]['time']}{$com['statement_info'][0]['account']}]" value="{$game['sum_money']}" style="width: 20px;display: none">
@ -264,7 +264,7 @@
<td><span class="pay_amount">{$account['game_list'][0]['pay_amount']}</span></td>
<!-- <td>{$account['game_list'][0]['ratio']|showNumPercent}</td>-->
<!-- <td>{$account['game_list'][0]['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="refund" value="{$account['game_list'][0]['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td>{$account['game_list'][0]['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$account['game_list'][0]['increment_ratio']}" style="width: 25px;">%</td>
<td>
@ -280,8 +280,8 @@
<notempty name="account['time']">
<td rowspan="{$account['time_row']}">
<input class="withhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
<input class="withhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;" name="withhold[{$com['id']}][{$account['game_list'][0]['game_name']}{$account['time']}{$account['account']}][{$account['game_list'][0]['statement_begin_time']}]">
<input class="oldwithhold" value="{$account['withhold_amount']|default=0}" style="width: 40px;display: none">
</td>
<td rowspan="{$account['time_row']}"><span class="week_amount">{$account['week_amount']}</span><input style="display: none" class="week_amount_input" value="{$account['week_amount']}"></td>
</notempty>
@ -309,7 +309,7 @@
<td><span class="pay_amount">{$game['pay_amount']}</span></td>
<!-- <td>{$game['ratio']|showNumPercent}</td>-->
<!-- <td>{$game['increment_ratio']|showNumPercent}</td>-->
<td><input class="refund" onkeyup ="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td><input class="refund" value="{$game['refund']|default=0}" style="width: 40px;" name="refund[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]"></td>
<td>{$game['ratio']}%</td>
<td><input class="increment_ratio" onkeyup ="if(value>100){value=100}else{value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')}if(value.indexOf(0)==0){value=0}" name="increment_ratio[{$com['id']}][{$game['game_name']}{$account['time']?$account['time']:$com['statement_info'][0]['time']}{$account['account']}]" value="{$game['increment_ratio']}" style="width: 25px;">%</td>
<td>
@ -374,6 +374,20 @@
});
});
</if>
$(".refund,.withhold").keyup(function() {
var val = $(this).val();
var reg = /^(\-|\+)?\d+(\.\d*)?$/g;
if (val == '-') {
return;
}
if( !reg.test(val)){
$(this).val(0)
}
});
$(".no_statement").on("click",function(){
var id = $(this).data('id');
saveForm(id);
@ -461,12 +475,24 @@
});
$(".refund").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
});
$(".withhold").on("blur",function () {
var val = $(this).val();
if (val == '-') {
$(this).val(0);
}
caculate_sum_money(this);
changeStatementAmount(this);
changeSumAmount();
@ -499,7 +525,7 @@
}
//退款
var refund = $(_this).parent().parent().find(".refund").val();
if (!refund || refund < 0) {
if (!refund) {
refund = 0;
$(_this).parent().parent().find(".refund").val(refund);
} else if(parseFloat(refund) > parseFloat(pay_money)) {

@ -254,6 +254,7 @@
<th >注册IP</th>
<th >最后登录时间</th>
<th >设备号</th>
<th >设备类型</th>
<th >去重数据</th>
<th >锁定备注</th>
<th >账号状态</th>
@ -348,6 +349,16 @@
</if>
<!--{$data.device_number}-->
</td>
<td>
<if condition="$data['device_type'] eq 1 ">
安卓
<elseif condition="$data['device_type'] eq 2 "/>
IOS
<else />
未知
</if>
</td>
<eq name="data.is_repeat" value="1">
<td></td>
<else/>

@ -0,0 +1,307 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">充值查询</h3>
<p class="description_text">充值汇总:根据推广员和游戏信息,对游戏充值数据按每日进行数据汇总统计。</p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
</div>
<div class="input-list">
<input type="text" id="time-start" name="timeStart" class="" value="{$startDate}"
placeholder="查询开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="timeEnd" class="" value="{$endDate}"
placeholder="查询结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="game_name" name="game_name" class="select_gallery" >
<option value="">游戏名称</option>
<volist name=":getAllGame()" id="vo">
<option value="{$vo.game_name}" <?php echo $vo.relation_game_name == I('game_name') ? 'selected':''; ?> >{$vo.game_name}</option>
</volist>
</select>
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('summation',array('row'=>I('row')))}">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th>日期</th>
<th>渠道来源</th>
<th>游戏名称</th>
<th>新增人数</th>
<th>活跃人数</th>
<th>新增玩家付费</th>
<th>本日累计付费</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<empty name = "list_data">
<tr>
<td colspan="8" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
<else/>
<volist name="list_data" id="data">
<tr>
<td>{$data.date}</td>
<td>{$data.from_channel}</td>
<td>{$data.game_name}</td>
<td>{$data.new_person}</td>
<td>{$data.active_person}</td>
<td>{$data.new_pay_person}</td>
<td>{$data.day_pay}</td>
</tr>
</volist>
</empty>
<tr class="data_summary">
<td>汇总</td>
<td colspan="6">当页付费¥{$total.current|default=0} 累计付费¥{$total.sum}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="page">
<if condition="$role_export_check eq true ">
<a class="sch-btn" href="{:U('RechargeSum/summation',array_merge(array('export'=>1,'xlsname'=>'游戏订单_充值汇总'),I('get.')))}">导出</a>
</if>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="RechargeSum/summation">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
$(".select_gallery").select2();
$('#bindcoin').select2({minimumResultsForSearch: -1});
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav('{:U('RechargeSum/summation')}');
$(function(){
//搜索功能
$("#search").click(function(){
var sdate = Date.parse($('#time-start').val()) / 1000;
var edate = Date.parse($('#time-end').val()) / 1000;
if (sdate > edate) {
layer.msg('开始时间必须小于等于结束时间');
return false;
}
if ((edate - sdate) > 2592000) {
layer.msg('时间间隔不能超过31天请重新选择日期');
return false;
}
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&"+$('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
$(".paixu").click(function(){
var that=$(this);
$data_order=that.attr('data-order');
$order_type='{$userarpu_order}';
if($order_type==''||$order_type=='4'){
$(".sortBy").attr('name','data_order');
val='3,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}else if($order_type=='3'){
$(".sortBy").attr('name','data_order');
val='4,'+$data_order;
$(".sortBy").attr('value',val);
$("#search").click();
}
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
$("#admin").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$(this).find('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
$('#admin #i_list_id').on('keyup',function(event) {
var val = $.trim($(this).val()).toLowerCase();
$(this).closest('.drop-down').find('#i_list_idh').val(val);
});
$("#admin #i_list_li").find("a").each(function(){
$(this).click(function(){
var text = $.trim($(this).text()).toLowerCase();
$(this).closest('.drop-down').find("#i_list_id").val(text);
$(this).closest('.drop-down').find('#i_list_idh').val(text);
})
});
//下拉内容框
$(".drop-down2").on('click',function(event) {
var navlist = $(this).find('.i_list_li');
if (navlist.hasClass('hidden')) {
navlist.removeClass('hidden');
$('#i_list_id').focus().val('');
} else {
navlist.addClass('hidden');
}
$(document).one("click", function(){
navlist.addClass('hidden');
});
event.stopPropagation();
});
/* 状态搜索子菜单 */
$('#time-start').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd',
language: "zh-CN",
minView: 2,
autoclose: true,
pickerPosition: 'bottom-left'
})
var promote_id = "{:I('promote_id')}";
console.log(promote_id);
$("#promote_level").change(function(){
$.ajax({
url:"{:U('Ajax/getPromotersByLevelOther')}",
type:"get",
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';
// });
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
}
$("#promote_id").empty();
$("#promote_id").append(str);
$("#promote_id").select2();
}
})
});
$("#promote_level").change();
var server_id = "{:I('server_id')}";
$("#game_type").change(function(){
$.ajax({
url:"{:U('Ajax/getGmeServer')}",
type:"post",
data:{sdk_version:$("#game_type option:selected").val(), game_name:$("#game_name option:selected").val()},
dataType:'json',
success:function(data){
str = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_id+"' "+(server_id && data[i].server_id == server_id?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#server_id").empty();
$("#server_id").append(str);
$("#server_id").select2();
}
})
});
$("#game_name").change(function(){
$("#game_type").change();
});
$("#game_name").change();
})
</script>
</block>

@ -0,0 +1,202 @@
<extend name="Public/base"/>
<block name="body">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
.tooltip {
position: relative;
display: inline-block;
color: #056dae;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 250%;
background-color: #fff;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 80%;
left: 0;
margin-left: -70%;
border: #000 solid 1px;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
color: #000;
visibility: visible;
line-height: 20px;
}
</style>
<div class="cf main-place top_nav_list navtab_list">
<h3 class="page_title">退款统计</h3>
<p class="description_text"></p>
</div>
<div class="cf top_nav_list">
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<!--游戏类型搜索END-->
<div class="input-list input-list-promote search_label_rehab">
<select id="count_date" name="count_date" class="select_gallery" style="width:150px;">
<option value="">请选择月份</option>
<volist name="date_count" id="vo">
<option value="{$vo}" <if condition="$vo eq $_GET['count_date']">selected=selected</if>>{$vo}</option>
</volist>
</select>
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="user_account" class="search-input" value="{:I('user_account')}" placeholder="请输入玩家账号">&nbsp;
</div>
<div class="input-list">
<a class="sch-btn" href="javascript:;" id="search" url="{:U('userCount','model='.$model['name'].'&row='.I('row'),false)}"
style="width: 100px;border: #3C95C8 solid 1px;">搜索</a>
</div>
</div>
</div>
<!-- 数据列表 -->
<div class="data_list">
<empty name="show_status">
<div class="">
<table>
<!-- 表头 -->
<thead>
<tr>
<th >月份</th>
<th >玩家账号</th>
<th >退款金额</th>
<th >操作</th>
</tr>
</thead>
<!-- 列表 -->
<tbody>
<style>
.data-table thead th, .data-table tbody td{text-align:center}
.data-table tbody td{border-right:1px solid #DDDDDD;}
.d_list .drop-down ul {z-index:999;}
</style>
<if condition = "empty($data)">
<tr>
<td colspan="16" class="text-center">aOh! 暂时还没有内容!</td>
</tr>
</if>
<notemtpy name = "data">
<volist name="data" id="data">
<tr>
<td >{$data.month}</td>
<td >{$data.user_account}</td>
<td >{$data.refund_amount}</td>
<td >
<a href="{$data['jump_url']}" >查看</a>
</td>
</tr>
</volist>
<tr>
<td><span>汇总</span></td>
<td colspan="13" style="text-align: left;">累计退款:&nbsp;{$allcount|default=0}</td>
</tr>
</notemtpy>
</tbody>
</table>
</div>
</empty>
</div>
<div class="page">
<a class="sch-btn" href="{:U(CONTROLLER_NAME.'/'.ACTION_NAME,array_merge(['export'=>1],I('get.')))}" target="_blank">导出</a>
{$_page|default=''}
</div>
</block>
<block name="script">
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="__STATIC__/layer/extend/layer.ext.js" ></script>
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script>
<volist name=":I('get.')" id="vo">
Think.setValue('{$key}',"{$vo}");
</volist>
</script>
<script type="text/javascript">
//导航高亮
highlight_subnav("{:U('userCount')}");
$(function(){
$(".select_gallery").select2();
//搜索功能
$("#search").click(function(){
var url = $(this).attr('url');
var query = $('.jssearch').find('input').serialize();
query += "&" + $('.jssearch').find('select').serialize();
query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
query = query.replace(/^&/g,'');
if( url.indexOf('?')>0 ){
url += '&' + query;
}else{
url += '?' + query;
}
window.location.href = url;
});
//回车自动提交
$('.jssearch').find('input').keyup(function(event){
if(event.keyCode===13){
$("#search").click();
}
});
})
</script>
</block>

@ -199,6 +199,14 @@
</select>
</div>
<div class="input-list search_item input-list-gamenoticestatus">
<select id="is_refund" name="is_refund" class="select_gallery">
<option value="">退款状态</option>
<option value="1">已退款</option>
<option value="0">--</option>
</select>
</div>
<input type="hidden" name="" value="" class="sortBy">
<div class="input-list search_item">
@ -254,6 +262,7 @@
</a></th>
<th>充值方式</th>
<th>订单状态</th>
<th>退款状态</th>
<th>游戏通知状态</th>
<th>是否参与结算</th>
<th>操作</th>
@ -266,7 +275,7 @@
<else/>
<volist name="list_data" id="data">
<tr>
<td ><input class="ids" type="checkbox" data-ischeck="{$data.is_check}" value="{$data['id']}" name="ids[]"></td>
<td ><input class="ids" type="checkbox" data-ischeck="{$data.is_check}" data-isrefund="{$data.is_refund}" value="{$data['id']}" name="ids[]"></td>
<td>
<if condition="$show_data_power eq true ">
{$data.pay_order_number}
@ -339,6 +348,7 @@
{:get_info_status($data['pay_status'],9)}
</if>
</td>
<td>{$data.is_refund_str}</td>
<td>
<if condition="$data['pay_status'] eq 1"><span class="game_notice_status_color">{:get_info_status($data['pay_game_status'],14)}</span>
<elseif condition="$data.pay_status eq 0"/>
@ -354,19 +364,15 @@
if (!(substr($data['pay_order_number'], 0, 3) == "PF_" &&
substr($data['pay_order_number'], -2) == '_1')) {
?>
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and $data['pay_status'] eq 1">
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and $data['pay_status'] eq 1 and $data['is_refund'] eq 0">
<a class=" budan" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/repairEdit')}" style="width:100%;">补单</a>
<else/>
<span>补单</span>
</if>
<?php }?>
<br />
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and ($data['pay_status'] eq 0 or $data['pay_status'] eq 2)">
<if condition="($data['pay_game_status'] eq 0 or $data['pay_game_status'] eq 2) and ($data['pay_status'] eq 0 or $data['pay_status'] eq 2) and $data['is_refund'] eq 0">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>
@ -380,7 +386,7 @@
<if condition="$rule_count_check">
<tr class="data_summary">
<td colspan="2">汇总</td>
<td colspan="21">
<td colspan="22">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount')))}
累计充值:{$total}(此处只汇总充值成功的订单)
@ -770,10 +776,59 @@
}
});
});
})
$("#addRefund,#removeRefund").on("click",function(){
var id = $(this).attr("id");
if(id == "addRefund"){
var opname = "登记退款";
var opurl = "{:U('addRefund')}";
var opst ="[未退款]";
var status = [0];
}else if(id=="removeRefund"){
var opname = "取消退款";
var opurl = "{:U('removeRefund')}";
var opst ="[已退款]";
var status = [1];
}
var flag = false;
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
const isrefund = $(elem).data("isrefund");
if($.inArray(isrefund,status) > -1){
return $(elem).val();
}
}).get();
if(text.length < 1){
layer.msg("<font style='color:white'>" + '无需要'+opname+'的操作,仅'+opst+'状态可以进行'+opname+"</font>");
return;
}
text = text.join(",");
layer.confirm('【提示】'+opname+'退款功能仅用于登记相关数据,未引入结算', {
btn: ['确认','取消'],
title:false
}, function(index){
layer.close(index);
layer.load(2);
$.ajax({
type: "POST",
url: opurl,
dataType: 'json',
async: true,
data: {ids:text},
success:function(data){
layer.closeAll('loading');
if(data.status==1){
layer.msg("<font style='color:white'>" + data.info + "</font>");
setTimeout(function(){
window.location.reload();
},1500);
}else{
layer.msg("<font style='color:white'>" + data.info + "</font>");
return false;
}
}
});
});
})
/**

@ -55,6 +55,7 @@
<th>结算方式</th>
<th>添加人</th>
<th>审核状态</th>
</tr>
</thead>
@ -91,6 +92,13 @@
<td></td>
<td>{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td>{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;">{$data.verify}</td>
<else/>
<td>--</td>
</if>
</tr>
<!-- 如果有子级 -->
<?php else:?>
@ -118,6 +126,15 @@
<td><?=$data['detail'][1][$i]['settlement_type_text'] ?? '无'?></td>
<td rowspan="{$data['maxCount']}">{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td rowspan="{$data['maxCount']}">{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;" rowspan="{$data['maxCount']}">{$data.verify}</td>
<else/>
<td rowspan="{$data['maxCount']}">--</td>
</if>
</tr>
<?php else:?>
<tr>

@ -166,6 +166,11 @@
<div class="butnbox" >
<div class="butnlist jscheckbutn" style="margin-left: 2px">
<a class='butn verify' data-status="1" style='background-color: #3C95C8;'>审核通过</a>
<a class='butn verify' data-status="-1" style='background-color: red;'>审核拒绝</a>
<a class='butn verify' data-status="2" style='background-color: #3C95C8;'>审核撤回</a>
<if condition="$IS_SUBSITE eq true">
<a class='butn' id='coefficient_in_check' href="{:U('addreward')}" style='background-color: #3C95C8;'>奖惩导入</a>
</if>
@ -179,6 +184,7 @@
<!-- 表头 -->
<thead>
<tr>
<th><input class="check-all" type="checkbox"></th>
<th style="width: 100px;">游戏名</th>
<th style="width: 100px;">游戏合作方</th>
<th >结算时间</th>
@ -202,6 +208,7 @@
<th>结算方式</th>
<th>添加人</th>
<th>审核状态</th>
<th>操作</th>
</tr>
</thead>
@ -218,6 +225,7 @@
<!-- 如果没有子级 -->
<?php if(!$data['maxCount']):?>
<tr>
<td ><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td>{$data['relation_game_name']}</td>
<td>{$data['relation_game_partner']}</td>
<td>{$data['settlement_time']}</td>
@ -239,10 +247,20 @@
<td></td>
<td>{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td>{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;">{$data.verify}</td>
<else/>
<td>--</td>
</if>
<td>
<a href="{:U('StatementMangement/rewardManageDetail',array('id'=>$data['id']))}">查看 </a>
<a href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
<if condition="$data.is_verify neq 1">
<a href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</if>
</td>
</tr>
<!-- 如果有子级 -->
@ -250,6 +268,7 @@
<?php for($i=0; $i<$data['maxCount']; $i++):?>
<?php if($i == 0):?>
<tr>
<td rowspan="{$data['maxCount']}"><input class="ids" type="checkbox" value="{$data['id']}" name="ids[]"></td>
<td rowspan="{$data['maxCount']}">{$data['relation_game_name']}</td>
<td rowspan="{$data['maxCount']}">{$data['relation_game_partner']}</td>
<td rowspan="{$data['maxCount']}">{$data['settlement_time']}</td>
@ -271,10 +290,19 @@
<td><?=$data['detail'][1][$i]['settlement_type_text'] ?? '无'?></td>
<td rowspan="{$data['maxCount']}">{:get_admin_name($data['creater_id'])}</td>
<if condition="$data.is_verify eq 1">
<td rowspan="{$data['maxCount']}">{$data.verify}</td>
<elseif condition="$data.is_verify eq -1"/>
<td style="color:red;" rowspan="{$data['maxCount']}">{$data.verify}</td>
<else/>
<td rowspan="{$data['maxCount']}">--</td>
</if>
<td rowspan="{$data['maxCount']}">
<a style="padding: 0px;" href="{:U('StatementMangement/rewardManageDetail',array('id'=>$data['id']))}">查看 </a>
<a style="padding: 0px;" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a style="padding: 0px;" class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
<if condition="$data.is_verify neq 1">
<a style="padding: 0px;" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id']))}">编辑 </a>
<a style="padding: 0px;" class="confirm ajax-get" href="{:U('StatementMangement/rewardManageSave',array('id'=>$data['id'], 'delete'=>1))}">删除 </a>
</if>
</td>
</tr>
<?php else:?>
@ -297,11 +325,11 @@
</volist>
</notemtpy>
<tr>
<td colspan="10" class="text-center">合计</td>
<td colspan="11" class="text-center">合计</td>
<td class="text-center" id="total_reward">-{:array_sum(array_column($list, 'totalPunish'))}</td>
<td colspan="5" class="text-center">合计</td>
<td class="text-center" id="total_punish">{:array_sum(array_column($list, 'totalReward'))}</td>
<td colspan="3" class="text-center"></td>
<td colspan="4" class="text-center"></td>
</tr>
</tbody>
</table>
@ -357,6 +385,33 @@
,range: '~'
});
$(".verify").click(function(){
var status = $(this).data("status");
var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) {
return $(elem).val();
}).get();
$.ajax({
url:"{:U('verify')}",
type:"post",
data:{
status:status,
id:text
},
dataType:'json',
success:function(data){
layer.msg("<font style='color: white'>"+data.msg+"</font>");
if (data.status == 1) {
setTimeout(function () {
window.location.reload();
},1000)
}
}
})
});
// var partner_id = {:I('partner_id', 0)};
// function get_company_list()
// {

@ -82,6 +82,37 @@ class LeavePercentageFactory
}
/**
* 判断是否结算绩效
* @param string $date
* @param int $admin_id
* @return bool
*/
public function isTimeoutSettlement($date = '',$admin_id= 0) {
//未离职结算
if (!isset(self::$arrUnSettlementList[$admin_id])) {
return true;
}
//判断往后日期都不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])!=$date
&&strtotime($date)>self::$arrUnSettlementList[$admin_id]) {
return false;
}
//当月离职时间在职时间小于30天不结算
if (self::$arrUnSettlementList[$admin_id]
&&date("Y-m",self::$arrUnSettlementList[$admin_id])==$date
&&(self::$arrUnSettlementList[$admin_id]-self::$arrUnSettlementApplyList[$admin_id])>=86400*30) {
return false;
}
return true;
}
/**
* 离职定时器方法
*/

Loading…
Cancel
Save