优化设备名称为字典

master
chenzhi 5 years ago
parent 84fe51efef
commit f0a19cfc99

@ -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;
}
}

@ -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;

@ -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,'.','');
}

@ -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,'.','');

@ -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'] = '无';

@ -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();

Loading…
Cancel
Save