From f0a19cfc9915fbf092cd12583983f4d2d9946b82 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 24 Mar 2020 10:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=BE=E5=A4=87=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E4=B8=BA=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/function.php | 26 +++++++++++++++++++ .../Controller/ExportController.class.php | 4 +-- .../Controller/FinanceController.class.php | 4 +-- .../FinancePromoteController.class.php | 6 ++--- .../Controller/PayChannelController.class.php | 14 +++++----- .../Controller/TestOrderController.class.php | 2 +- 6 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Application/Admin/Common/function.php b/Application/Admin/Common/function.php index 4a6b153e6..18a0546c0 100644 --- a/Application/Admin/Common/function.php +++ b/Application/Admin/Common/function.php @@ -891,3 +891,29 @@ function clearGameNameType($game_name) { return preg_replace("/\(.*\)/","",$game_name); } +//设备名称词典 +function getGameTypeName($id,$chinese=true) +{ + $android = 'Android'; + $ios = 'ios'; + if($chinese){ + $android = '安卓'; + $ios = '苹果'; + } + $data = array( + ["id"=>0,'name'=>"{$android}+{$ios}"], + ["id"=>1,'name'=>$android], + ["id"=>2,'name'=> $ios] + ); + if($id > -1){ + foreach($data as $k=>$v){ + if($v['id'] == $id){ + return $v['name']; + break; + } + } + }else{ + return $data; + } +} + diff --git a/Application/Admin/Controller/ExportController.class.php b/Application/Admin/Controller/ExportController.class.php index e185ea878..ac9308087 100644 --- a/Application/Admin/Controller/ExportController.class.php +++ b/Application/Admin/Controller/ExportController.class.php @@ -2455,7 +2455,7 @@ class ExportController extends Controller $order_list['server_type'] = '测试外网'; } $order_list['game_name'] =clearGameNameType($v['game_name']); - $order_list['sdk_version'] =$v['sdk_version'] == 1 ? "安卓" : "苹果"; + $order_list['sdk_version'] =getGameTypeName($v['sdk_version']); $order_list['order_type'] = get_order_type($v['order_type']); $order_list['order_no'] = $v['order_no']; $order_list['cp_order_no'] = $v['cp_order_no']; @@ -8104,7 +8104,7 @@ class ExportController extends Controller foreach($xlsData as $key => $value) { $xlsData[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $xlsData[$key]['sdk_version'] =$xlsData[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $xlsData[$key]['sdk_version'] =getGameTypeName($xlsData[$key]['sdk_version']); } $map['pay_game_status'] = 1; diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index f5403389f..e13d5d9b8 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -848,7 +848,7 @@ class FinanceController extends ThinkController foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); } if(isset($_REQUEST['export'])){ @@ -985,7 +985,7 @@ class FinanceController extends ThinkController foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); $data[$key]['cost'] = number_format($value['cost'],2,'.',''); $data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.',''); } diff --git a/Application/Admin/Controller/FinancePromoteController.class.php b/Application/Admin/Controller/FinancePromoteController.class.php index 5c406446d..3a3fe5c64 100644 --- a/Application/Admin/Controller/FinancePromoteController.class.php +++ b/Application/Admin/Controller/FinancePromoteController.class.php @@ -458,7 +458,7 @@ class FinancePromoteController extends AdminController $value['company_belong'] =getCompanyBlong($value['company_belong']); $value['game_name'] =clearGameNameType($value['game_name']); - $value['sdk_version'] =$value['sdk_version'] == 1 ? "安卓" : "苹果"; + $value['sdk_version'] =getGameTypeName($value['sdk_version']); if(!$value['game_name']) $value['game_name'] = "无"; } @@ -578,7 +578,7 @@ class FinancePromoteController extends AdminController foreach($data as $key => $value) { $data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); } if (isset($_REQUEST['export'])) { @@ -743,7 +743,7 @@ class FinancePromoteController extends AdminController $data[$key]['pay_way'] = getPayType($value['pay_way']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); $data[$key]['cost'] = number_format($value['cost'],2,'.',''); $data[$key]['pay_amount'] = number_format($value['pay_amount'],2,'.',''); diff --git a/Application/Admin/Controller/PayChannelController.class.php b/Application/Admin/Controller/PayChannelController.class.php index ca6371d92..b305ff4b3 100644 --- a/Application/Admin/Controller/PayChannelController.class.php +++ b/Application/Admin/Controller/PayChannelController.class.php @@ -10,7 +10,9 @@ use Org\WeixinSDK\Weixin; class PayChannelController extends ThinkController { public function index($p = 0) { - + if(!array_key_exists("timestart",$_REQUEST)){ + $this->redirect(ACTION_NAME, array('timestart' => date('Y-m-d',strtotime('-30 day')),"timeend"=>date('Y-m-d'))); + } $page = intval($p); $page = $page ? $page : 1; //默认显示第一页数据 $arraypage = $page; @@ -126,7 +128,7 @@ class PayChannelController extends ThinkController $data[$key]['test_coin'] = $handleTestData[$value['game_id']]?$handleTestData[$value['game_id']]:0; $data[$key]['test_platform_coin'] = $handleTestCoinData[$value['game_id']]?$handleTestCoinData[$value['game_id']]:0; $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); } $superMap = $map; // unset($superMap['promote_id']); @@ -659,7 +661,7 @@ class PayChannelController extends ThinkController if ($model == 'spend') { $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); } } @@ -872,7 +874,7 @@ class PayChannelController extends ThinkController foreach ($xlsData as $k => $v) { if ($model == 'spend') { $v['game_name'] =clearGameNameType($v['game_name']); - $v['sdk_version'] =$v['sdk_version'] == 1 ? "安卓" : "苹果"; + $v['sdk_version'] =getGameTypeName($v[$key]['sdk_version']); } $v['pay_time'] = date('Y-m-d H:i:s',$v['pay_time']); $v['pay_way'] = get_pay_way($v['pay_way']); @@ -1037,7 +1039,7 @@ class PayChannelController extends ThinkController $data[$key]['pay_type'] = get_pay_way($value['pay_type']); $data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']); - $data[$key]['sdk_version'] =$data[$key]['sdk_version'] == 1 ? "安卓" : "苹果"; + $data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']); if ($value['pay_way']==1 || $value['pay_way']==9 ) { $data[$key]['pay_way'] = '支付宝'; @@ -1369,7 +1371,7 @@ class PayChannelController extends ThinkController $value['pay_order_number'] = "'".$value['pay_order_number']; $value['order_number'] = "'".$value['order_number']; $value['game_name'] =clearGameNameType($value['game_name']); - $value['sdk_version'] =$value['sdk_version'] == 1 ? "安卓" : "苹果"; + $value['sdk_version'] =getGameTypeName($value['sdk_version']); if (!$value['order_number']) { $data[$key]['order_number'] = '无'; diff --git a/Application/Admin/Controller/TestOrderController.class.php b/Application/Admin/Controller/TestOrderController.class.php index 10f36f285..ec50da15b 100644 --- a/Application/Admin/Controller/TestOrderController.class.php +++ b/Application/Admin/Controller/TestOrderController.class.php @@ -53,7 +53,7 @@ class TestOrderController extends ThinkController ->where($map)->page($page,$row)->order('add_time desc')->select(); foreach ($order_list as $k => &$v) { $v['game_name'] =clearGameNameType($v['game_name']); - $v['sdk_version'] =$v['sdk_version'] == 1 ? "安卓" : "苹果"; + $v['sdk_version'] =getGameTypeName($v['sdk_version']); } $sum_order_amount = M('test_order', 'tab_')->where($map)->field('sum(order_amount) as sum_order_amount,count(1) as count')->find(); $sum_pay_amount = M('test_order', 'tab_')->where($map)->field('sum(pay_amount) as sum_order_amount')->find();