diff --git a/Application/Admin/Controller/AutoController.class.php b/Application/Admin/Controller/AutoController.class.php index 6ebe18b4b..b442ad320 100644 --- a/Application/Admin/Controller/AutoController.class.php +++ b/Application/Admin/Controller/AutoController.class.php @@ -890,5 +890,31 @@ public function auto_rrdae(){ } } + //根据时间统计玩家充值 + public function userPlayDataCount() + { + $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); + $spendMap['pay_status'] = 1; + $spendMap['pay_game_status'] = 1; + $spendMap['game_player_id'] = ['gt', 0]; + $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; + + $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; + $spendCostData = M('spend', 'tab_')->field($field) + ->where($spendMap) + ->group('day,game_player_id,server_id,game_id') + ->select(); + $data = []; + foreach ($spendCostData as $list) { + $save['game_id'] = $list['game_id']; + $save['server_id'] = $list['server_id']; + $save['role_id'] = $list['game_player_id']; + $save['recharge_cost'] = $list['recharge_cost']; + $save['recharge_count'] = $list['recharge_count']; + $save['create_time'] = strtotime($list['day']); + $data[] = $save; + } + M('user_play_data_count', 'tab_')->addAll($data); + } } diff --git a/Application/Admin/Controller/PlatformController.class.php b/Application/Admin/Controller/PlatformController.class.php index 965da8b24..393455386 100644 --- a/Application/Admin/Controller/PlatformController.class.php +++ b/Application/Admin/Controller/PlatformController.class.php @@ -387,6 +387,23 @@ class PlatformController extends ThinkController ->group('tp1.id') ->order('count desc, register_time') ->select(); + + //官方渠道数据添加 + $authorityData = M('user', 'tab_')->field('date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(id) as count, + count(IF(register_time ' . $today . ',1,null)) as today, + count(IF(register_time ' . $week . ',1,null)) as week, + count(IF(register_time ' . $mounth . ',1,null)) as mounth') + ->where(['promote_id'=>0]) + ->find(); + $authorityData['promote_account'] = "官方渠道"; + $authorityData['id'] = "1"; +// $authorityData = []; + + array_push($data, $authorityData); + //数据排序 + $last_names = array_column($data,'count'); + array_multisort($last_names,SORT_DESC,$data); + $count = count($data); foreach ($data as $key => $value) { static $i = 0; diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 6f38130b5..8ed98c5b7 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -1053,7 +1053,7 @@ function is_check_account($account){ $map[$field]=$game_id; $data=M('game','tab_')->where($map)->find(); if(empty($data)){return '';} - return $data['dratio']; + return $data['ratio']; } /** diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 1a464a126..47d5583fe 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -419,6 +419,7 @@ class DownloadController extends BaseController { $ids = implode(',', $ids); $map = []; $map['promote_id'] = ['in', $ids]; + $map['pay_status'] = 1; if (!empty($payOrderNumber)) { $map['pay_order_number'] = $payOrderNumber; } @@ -2123,6 +2124,11 @@ class DownloadController extends BaseController { foreach ($data as $key => $value) { $value['create_time'] = date("Y-m-d H:i:s", $value['create_time']); $value['user_account'] = $this->encryption($value['user_account']); + if($value['check_status'] == 1) { + $value['check_status'] = "正常"; + }else { + $value['check_status'] = "拉黑"; + } //获取累计发放 $where = array( "user_id"=>$value['user_id'], @@ -2205,9 +2211,9 @@ class DownloadController extends BaseController { $data[$key]['create_time'] = date('Y-m-d H:m:i',$value['create_time']); $data[$key]['user_account'] = $this->encryption($value['user_account']); if($value['check_status'] == 1) { - $data[$key]['check_status'] = "冻结"; - }else { $data[$key]['check_status'] = "启用"; + }else { + $data[$key]['check_status'] = "冻结"; } } $xlsData = $data; @@ -2434,7 +2440,7 @@ class DownloadController extends BaseController { array('income','收益'), array('pay_time','充值时间'), array('selle_status','订单状态'), - ); + ); $model = M('spend', 'tab_'); $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') ->where($map) diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 605c26ad4..f8b4e8ceb 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -15,6 +15,7 @@ class FinanceController extends BaseController { //提现状态 public static $withdrawStatus = [ + -2 => '已撤销', -1 => '审核未通过', 0 => '待审核', 1 => '汇款中', @@ -200,7 +201,7 @@ class FinanceController extends BaseController $map['pay_order_number'] = $payOrderNumber; } if (isset($_GET['status'])) { - if ($status == -2) { + if ($status == -99) { $map['selle_status'] = 0; } else { $withdrawMap['promote_id'] = $this->loginPromote['id']; @@ -277,8 +278,7 @@ class FinanceController extends BaseController //是否是会长 $this->purview(); //验证安全密码 - $metaTitle = '结算明细'; - $modelList = ['财务管理', $metaTitle]; + $modelList = []; $res = $this->verifyPasswordView($modelList, false); if ($res == false) { $data['status'] = 0; @@ -329,6 +329,7 @@ class FinanceController extends BaseController $add['status'] = 0; $add['widthdraw_number'] = $this->produceWithdrawNumber(); $add['settlement_end_time'] = $thisDay - 1; + $add['spend_ids'] = ''; M()->startTrans();//开启事物 $withdrawId = M('withdraw', 'tab_')->add($add); @@ -399,11 +400,9 @@ class FinanceController extends BaseController } if (isset($_GET['status']) && $_GET['status'] !== '') { $status = intval($_GET['status']); - if (!isset(FinanceController::$withdrawStatus[$status])) { - $this->error('参数异常'); + if (isset(FinanceController::$withdrawStatus[$status])) { + $map['status'] = $status; } - - $map['status'] = $status; } $data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond,transfer_proof') @@ -420,8 +419,15 @@ class FinanceController extends BaseController $list['create_time'] = date('Y-m-d H:i:s', $list['create_time']); $list['settlement_end_time'] = date('Y-m-d H:i:s', $list['settlement_end_time']); $list['status_name'] = FinanceController::$withdrawStatus[$list['status']]; - if ($list['status'] == -1) { - $list['status_name'] = '' . $list['status_name'] . ''; + switch ($list['status']) { + case -2: + $list['status_name'] = '' . $list['status_name'] . ''; + break; + case -1: + $list['status_name'] = '' . $list['status_name'] . ''; + break; + default: + break; } } } @@ -572,8 +578,7 @@ class FinanceController extends BaseController //是否是会长 $this->purview(); //验证安全密码 - $metaTitle = '结算明细'; - $modelList = ['财务管理', $metaTitle]; + $modelList = []; $res = $this->verifyPasswordView($modelList, false); if ($res == false) { $data['status'] = 0; @@ -606,4 +611,69 @@ class FinanceController extends BaseController } $this->ajaxReturn($data); } + + //撤销提现 + public function cancelWithdraw() + { + //是否是会长 + $this->purview(); + //验证安全密码 + $modelList = []; + $res = $this->verifyPasswordView($modelList, false); + if ($res == false) { + $data['status'] = 0; + $data['msg'] = '权限异常'; + $this->ajaxReturn($data); + } + + $id = intval(I('id', 0)); + $data = M('withdraw', 'tab_')->find($id); + if (empty($data) || !in_array($data['status'], [-1, 0])) { + $data['status'] = 0; + $data['msg'] = '数据异常'; + $this->ajaxReturn($data); + } + if ($data['promote_id'] != $this->loginPromote['id']) { + $data['status'] = 0; + $data['msg'] = '权限异常'; + $this->ajaxReturn($data); + } + + $spendMap['withdraw_id'] = $id; + $spendIds = M('Spend', 'tab_')->where($spendMap)->getField('id', true); + if (empty($spendIds)) { + $data['status'] = 0; + $data['msg'] = '数据异常'; + $this->ajaxReturn($data); + } + $spendIds = implode(',', $spendIds); + $time = time(); + $withdrawSave['id'] = $id; + $withdrawSave['status'] = -2; + $withdrawSave['spend_ids'] = $spendIds; + $withdrawSave['last_up_update_time'] = $time; + + M('withdraw', 'tab_')->startTrans();//开启事物 + $withdrawRes = M('withdraw', 'tab_')->save($withdrawSave); + if ($withdrawRes === false) { + M('withdraw', 'tab_')->rollback();//事物回滚 + $data['status'] = 0; + $data['msg'] = '撤销失败'; + $this->ajaxReturn($data); + } + + $spendSave['selle_status'] = 0; + $spendSave['withdraw_id'] = 0; + $spendRes = M('spend', 'tab_')->where($spendMap)->save($spendSave); + if ($spendRes === false) { + M('withdraw', 'tab_')->rollback();//事物回滚 + $data['status'] = 0; + $data['msg'] = '撤销失败'; + } else { + M('withdraw', 'tab_')->commit();//事物提交 + $data['status'] = 1; + $data['msg'] = '撤销成功'; + } + $this->ajaxReturn($data); + } } \ No newline at end of file diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index 4d0f5061b..be50a7529 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -2134,31 +2134,4 @@ class QueryController extends BaseController $this->ajaxReturn($data); } - - public function userPlayDataCount() - { - $time = strtotime(date('Y-m-d 00:00:00', time() - (3600 * 24))); - $spendMap['pay_status'] = 1; - $spendMap['pay_game_status'] = 1; - $spendMap['game_player_id'] = ['gt', 0]; - $spendMap['pay_time'] = ['between', [$time, strtotime(date('Y-m-d 23:59:59', $time))]]; - - $field = 'FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day,game_id,server_id,game_player_id,sum(pay_amount) as recharge_cost,count(id) as recharge_count'; - $spendCostData = M('spend', 'tab_')->field($field) - ->where($spendMap) - ->group('day,game_player_id,server_id,game_id') - ->select(); - - $data = []; - foreach ($spendCostData as $list) { - $save['game_id'] = $list['game_id']; - $save['server_id'] = $list['server_id']; - $save['role_id'] = $list['game_player_id']; - $save['recharge_cost'] = $list['recharge_cost']; - $save['recharge_count'] = $list['recharge_count']; - $save['create_time'] = strtotime($list['day']); - $data[] = $save; - } - M('user_play_data_count', 'tab_')->addAll($data); - } } diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html index 2cbb07ea2..aefcaf46a 100644 --- a/Application/Home/View/default/Finance/settlementDtl.html +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -103,8 +103,8 @@
已撤销
+公司地址:福建省福州市鼓楼区福大怡山文化创意园11号楼103号
-联系人: 雷女士
-联系电话: 13067391751
+公司地址:福建省福州市鼓楼区福大怡山文化创意园11号楼103号
+联系人: 雷女士
+联系电话: 13067391751
邮政编码:350004