diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index f2e08137d..3664cde6a 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -560,6 +560,27 @@ function getGameByName($game_name=null, $sdk_version=null) return $result; } } +//根据游戏公司,游戏名称,游戏类型 +function getGameidByPartnerNameType($partner_id=null,$game_name=null, $sdk_version=null) +{ + $map = []; + if($partner_id){ + $map['partner_id'] = $partner_id; + } + if ($game_name) { + $map['relation_game_name'] = $game_name; + } + if ($sdk_version) { + $map['sdk_version'] = $sdk_version; + } + $result = D("Game")->field('id')->where($map)->select(); + if(empty($result)) { + return [['id' => -1]]; + }else + { + return $result; + } +} function getTopPromote($promote_id) { diff --git a/Application/Admin/Controller/BehaviorLogController.class.php b/Application/Admin/Controller/BehaviorLogController.class.php index b9ac94d06..5306bc473 100644 --- a/Application/Admin/Controller/BehaviorLogController.class.php +++ b/Application/Admin/Controller/BehaviorLogController.class.php @@ -5,6 +5,15 @@ namespace Admin\Controller; class BehaviorLogController extends ThinkController { + private $single_type = [ + 0 => '通知到账', + 1 => '补单', + ]; + + /** + * 游戏预下单记录 + * @return [type] [description] + */ public function game() { $params = I('get.'); @@ -67,7 +76,7 @@ class BehaviorLogController extends ThinkController $data[$k]['server_name'] = ''; $data[$k]['game_player_name'] = ''; $data[$k]['game_player_id'] = ''; - + } } $count = M('pay_info', 'tab_')->where($map)->count(); @@ -82,4 +91,77 @@ class BehaviorLogController extends ThinkController $this->display('index'); } + + /** + * 补单记录 + * @return [type] [description] + */ + public function singleSupplement() { + $p = I('get.p', 1); + $row = I('get.row', 10); + $params = I('get.'); + + if(isset($params['timestart']) && isset($params['timeend'])) { + $startTime = strtotime($params['timestart']); + $endTime = strtotime($params['timeend']) + 86399; + $map['tab_repair_pay.create_time'] = array('BETWEEN', [$startTime, $endTime]); + } + + if(isset($params['type'])) { + $map['tab_repair_pay.type'] = $params['type']; + } + + if(isset($params['pay_order_number'])) { + $map['tab_repair_pay.pay_order_number'] = $params['pay_order_number']; + } + + if(isset($params['admin_name'])) { + $map['tab_repair_pay.admin_name'] = $params['admin_name']; + } + + + if(!empty(I('get.order_number'))) { + $map['tab_spend.order_number'] = I('get.order_number'); + $data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select(); + } else { + $data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select(); + } + + $show_data = []; + foreach($data as $k => $v) { + if($v['tab'] == 'spend') { + $order_detail = M('spend', 'tab_')->field('order_number,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); + $re_data['pay_time'] = $order_detail['pay_time']; + } elseif($v['tab'] == 'deposit') { + $order_detail = M('deposit', 'tab_')->field('order_number,create_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); + $re_data['pay_time'] = $order_detail['create_time']; + } + $re_data['order_number'] = !empty($order_detail['order_number']) ? $order_detail['order_number'] : '-'; + $re_data['user_account'] = $order_detail['user_account']; + $re_data['promote_account'] = $order_detail['promote_account']; + $re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-'; + $re_data['pay_amount'] = $order_detail['pay_amount']; + $re_data['pay_way'] = get_pay_way($order_detail['pay_way']); + $re_data['pay_order_number'] = $v['pay_order_number']; + $re_data['type'] = $this->single_type[$v['type']]; + $re_data['create_time'] = $v['create_time']; + $re_data['admin_name'] = $v['admin_name']; + $show_data[] = $re_data; + } + + if(!empty(I('get.order_number'))) { + $map['tab_spend.order_number'] = I('get.order_number'); + $count = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->count(); + } else { + $count = M('repair_pay', 'tab_')->where($map)->count(); + } + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + $this->assign('show_data', $show_data); + + $this->display('singleSupplement'); + + } } diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index 93782c10b..2a87bac71 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2097,6 +2097,70 @@ class ExportController extends Controller $xlsData[0]['money_all'] = $xlsData[0]['buy_num'] * 10; $xlsData[0]['authorization_all_num'] = $authorization_all_num; break; + case 25: + $xlsCell = array( + array('type', '类型'), + array('pay_order_number', '支付订单号'), + array('order_number', 'CP订单号'), + array('pay_time', '充值时间'), + array('user_account', '玩家账号'), + array('promote_account', '所属推广员'), + array('game_name', '游戏名称'), + array('pay_amount', '实付金额'), + array('pay_way', '充值方式'), + array('admin_name', '补单管理员'), + array('create_time', '补单时间'), + ); + + $params = I('get.'); + if(isset($params['timestart']) && isset($params['timeend'])) { + $startTime = strtotime($params['timestart']); + $endTime = strtotime($params['timeend']) + 86399; + $map['tab_repair_pay.create_time'] = array('BETWEEN', [$startTime, $endTime]); + } + + if(isset($params['type'])) { + $map['tab_repair_pay.type'] = $params['type']; + } + + if(isset($params['pay_order_number'])) { + $map['tab_repair_pay.pay_order_number'] = $params['pay_order_number']; + } + + if(isset($params['admin_name'])) { + $map['tab_repair_pay.admin_name'] = $params['admin_name']; + } + + + if(!empty(I('get.order_number'))) { + $map['tab_spend.order_number'] = I('get.order_number'); + $data = M('repair_pay', 'tab_')->join('tab_spend on tab_spend.pay_order_number = tab_repair_pay.pay_order_number')->where($map)->page($p, $row)->order('tab_repair_pay.id DESC')->select(); + } else { + $data = M('repair_pay', 'tab_')->where($map)->page($p, $row)->order('id DESC')->select(); + } + + $xlsData = []; + foreach($data as $k => $v) { + if($v['tab'] == 'spend') { + $order_detail = M('spend', 'tab_')->field('order_number,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); + $re_data['pay_time'] = set_show_time($order_detail['pay_time']); + } elseif($v['tab'] == 'deposit') { + $order_detail = M('deposit', 'tab_')->field('order_number,create_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); + $re_data['pay_time'] = set_show_time($order_detail['create_time']); + } + $re_data['order_number'] = !empty($order_detail['order_number']) ? $order_detail['order_number'] : '-'; + $re_data['user_account'] = $order_detail['user_account']; + $re_data['promote_account'] = $order_detail['promote_account']; + $re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-'; + $re_data['pay_amount'] = $order_detail['pay_amount']; + $re_data['pay_way'] = get_pay_way($order_detail['pay_way']); + $re_data['pay_order_number'] = $v['pay_order_number']; + $re_data['type'] = $v['type'] == 1 ? '补单' : '通知到账'; + $re_data['create_time'] = set_show_time($v['create_time']); + $re_data['admin_name'] = $v['admin_name']; + $xlsData[] = $re_data; + } + break; default: $xlsName = $xlsCell = $xlsData = []; diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 2b5771476..aed71247f 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -719,12 +719,17 @@ class FinanceController extends ThinkController } if (!empty(I('timeend'))) { - $timeend = strtotime(I('timeend')); - $map['_string'] .= " and s.pay_time < {$timeend}"; + $timeend = strtotime(I('timeend') . ' 23:59:59'); + if (!empty($map['_string'])) { + $map['_string'] .= " and "; + } + $map['_string'] .= " s.pay_time < {$timeend}"; } - + $startTime = time(); //游戏统计列表 $data = D("spend")->gameStatistics($map, $row, $p); + $endTime = time(); + foreach ($data as $key => $value) { $data[$key]['all_cash_count'] = $value['cash_count'] + $value['balance_coin_count'] + $value['inside_cash_count']; } @@ -777,8 +782,11 @@ class FinanceController extends ThinkController } if (!empty(I('timeend'))) { - $timeend = strtotime(I('timeend')); - $map['_string'] .= " and pay_time < {$timeend}"; + $timeend = strtotime(I('timeend') . ' 23:59:59'); + if (!empty($map['_string'])) { + $map['_string'] .= " and "; + } + $map['_string'] .= " pay_time < {$timeend}"; } if (!empty(I("promote_id"))) { @@ -807,7 +815,7 @@ class FinanceController extends ThinkController } else { $row = 10; } - $map['pay_status'] = 1; + $map['pay_game_status'] = 1; if (!empty(I("game_id"))) { $map['game_id'] = I("game_id"); } @@ -821,12 +829,14 @@ class FinanceController extends ThinkController $field = "pay_order_number,FROM_UNIXTIME(pay_time) as pay_time,user_account,user_nickname,game_name,promote_account,spend_ip,server_name,game_player_name,pay_amount,cost,pay_way"; $group = ""; $order = "pay_time DESC"; + $data = D('spend')->getSpendData($map,$field,$group,$order,$page,$row); foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); } $totalData = D('spend')->totalGameStatistics($map, false); + $sumCash = $totalData['cash_count'] ?? 0; $sumBalance = $totalData['balance_coin_count'] ?? 0; $sumInside = $totalData['inside_cash_count'] ?? 0; diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 8304524a3..27f5c6275 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -121,6 +121,7 @@ class FinancePromoteController extends AdminController } private function getJoinPromoteData($map,$istimeselect,$type="spend") { + setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; @@ -276,6 +277,7 @@ class FinancePromoteController extends AdminController } private function promoteUserData($map,$istimeselect,$type="spend") { + setPowerPromoteIds($map,"s.promote_id"); if ($_REQUEST['promote_id'] != '') { if ($_REQUEST['promote_id'] == 0) { $map['s.promote_id'] = 0; @@ -436,14 +438,8 @@ class FinancePromoteController extends AdminController $map['pay_order_number'] = $_REQUEST['pay_order_number']; } - if (!empty(I('partner_id'))) { - $wherePartner = I('partner_id'); - $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); - $gameId = implode(',',array_column($gameId,'id')); - $map['game_id'] = ['in',$gameId]; - } - if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { - $map["game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) { + $map["game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { @@ -595,18 +591,21 @@ class FinancePromoteController extends AdminController $map['pay_order_number'] = $_REQUEST['pay_order_number']; } - if (!empty(I('partner_id'))&&empty(I("game_id"))) { - $wherePartner = I('partner_id'); - $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); - $gameId = implode(',',array_column($gameId,'id')); - $map['tab_spend.game_id'] = ['in',$gameId]; - } + // if (!empty(I('partner_id'))&&empty(I("game_id"))) { + // $wherePartner = I('partner_id'); + // $gameId = M("game","tab_")->field("id")->where("partner_id={$wherePartner}")->select(); + // $gameId = implode(',',array_column($gameId,'id')); + // $map['tab_spend.game_id'] = ['in',$gameId]; + // } if (!empty(I("game_id"))) { $map['tab_spend.game_id'] = I("game_id"); } - if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { - $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type']) || isset($_REQUEST['partner_id'])) { + $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameidByPartnerNameType($_REQUEST['partner_id'],$_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); } + // if (isset($_REQUEST['game_name']) || isset($_REQUEST['game_type'])) { + // $map["tab_spend.game_id"] = array("in",implode(',', array_column(getGameByName($_REQUEST['game_name'], $_REQUEST['game_type']), 'id')) ); + // } if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { $map['pay_time'] = ['between', [strtotime($_REQUEST['time_start']), strtotime($_REQUEST['time_end']) + 86399]]; diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 6f02ec65b..0397a1dd4 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -187,7 +187,7 @@ class MendController extends ThinkController { private function checkPromote($order_time,$account) { $res = M("Spend","tab_")->field("promote_id")->where(["pay_time"=>array("EGT",$order_time),"user_account"=>$account])->group("promote_id")->select(); - if(count($res)>0) return true; + if(count($res)>1) return true; return false; } //补链详情 diff --git a/Application/Admin/Model/SpendModel.class.php b/Application/Admin/Model/SpendModel.class.php index 31a4385f2..f7177406b 100644 --- a/Application/Admin/Model/SpendModel.class.php +++ b/Application/Admin/Model/SpendModel.class.php @@ -873,6 +873,7 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count"); $data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1]) ->where($map) ->find(); +// dd($query->_sql()); return $data; } diff --git a/Application/Admin/View/BehaviorLog/singleSupplement.html b/Application/Admin/View/BehaviorLog/singleSupplement.html new file mode 100644 index 000000000..28cc12552 --- /dev/null +++ b/Application/Admin/View/BehaviorLog/singleSupplement.html @@ -0,0 +1,373 @@ + + + + + + + + + + + +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + - +
+ + +
+
+ + +
+ 搜索 +
+
+ + +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
类型支付订单号CP订单号充值时间玩家账号所属推广员游戏名称实付金额充值方式补单管理员补单时间
aOh! 暂时还没有内容!
{$vo.type}{$vo.pay_order_number}{$vo.order_number}{:set_show_time($vo['pay_time'])}{$vo.user_account}{$vo.promote_account}{$vo.game_name}{$vo.pay_amount}{$vo.pay_way}{$vo.admin_name}{:set_show_time($vo['create_time'])}
+
+
+
+ 导出 + {$_page|default=''} +
+ + + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ' + + '; + + + + + + + + diff --git a/Application/Admin/View/Finance/gameStatistics.html b/Application/Admin/View/Finance/gameStatistics.html index c657ecdc9..ea095add9 100644 --- a/Application/Admin/View/Finance/gameStatistics.html +++ b/Application/Admin/View/Finance/gameStatistics.html @@ -72,7 +72,7 @@
diff --git a/Application/Admin/View/FinancePromote/gameStatistics.html b/Application/Admin/View/FinancePromote/gameStatistics.html index 3e26b5414..e4351eab5 100644 --- a/Application/Admin/View/FinancePromote/gameStatistics.html +++ b/Application/Admin/View/FinancePromote/gameStatistics.html @@ -224,7 +224,7 @@