Merge branch 'hotfix/sqshortcut' into dev

master
zhengyongxing 5 years ago
commit 15bf827fb3

@ -360,3 +360,28 @@ function log_action($log) {
$log['create_time'] = time(); $log['create_time'] = time();
M('user_action_log', 'tab_')->data($log)->add(); M('user_action_log', 'tab_')->data($log)->add();
} }
/**
* 是否开启苹果内购通知
* @return bool
*/
function getAppleInteriorBuyStatus() {
$appleInteriorBuyStatus = M('tool','tab_')->where(['name'=>'apple_interior_buy'])->getField('status');
return $appleInteriorBuyStatus?true:false;
}
/**
* 记录行为日志
* @param $user_id
* @return bool
*/
function getIpForbitWhiteList($user_id) {
$is_white_list = M('forbit_ip', 'tab_')->where(['user_id'=>$user_id,'status'=>1])->find();
return $is_white_list?true:false;
}

@ -725,7 +725,7 @@ class ExchangeController extends BaseController{
$map['pay_order_number'] = $out_trade_no; $map['pay_order_number'] = $out_trade_no;
$payamountVerify=M('spend','tab_')->field('id,pay_order_number,extend,pay_amount')->where($map)->find(); $payamountVerify=M('spend','tab_')->field('id,pay_order_number,extend,pay_amount,user_id')->where($map)->find();
if($payamountVerify['pay_amount']!=$request['price']){ if($payamountVerify['pay_amount']!=$request['price']){
@ -763,9 +763,42 @@ class ExchangeController extends BaseController{
$param['out_trade_no'] = $out_trade_no; $param['out_trade_no'] = $out_trade_no;
$isBeta = false;
$isUSBeta = false;
if (isset($request['app_type']) && $request['app_type'] == 2) {
$isBeta = true;
// 美国IP 贝塔版
$ip = get_client_ip();
// todo: 暂时取消美国IP 后面做白名单
$isUSBeta = ip_is_country($ip);
// $isUSBeta = false;
}
$game = new GameApi(); $game = new GameApi();
$game->game_pay_notify($param); //判断是否开启苹果内购支付通知
$appleInteriorBuyStatus = M('tool','tab_')->where(['name'=>'apple_interior_buy'])->getField('status');
if (!$appleInteriorBuyStatus) {
if ($isBeta && $isUSBeta) {
$is_white_list = M('forbit_ip', 'tab_')->where(['user_id'=>$payamountVerify['user_id'],'status'=>1])->find();
if ($is_white_list) {
$game->game_pay_notify($param);
}
} else {
$game->game_pay_notify($param);
}
} else {
$game->game_pay_notify($param);
}
break; break;

@ -156,8 +156,8 @@ class GameController extends BaseController{
// 美国IP 贝塔版 // 美国IP 贝塔版
$ip = get_client_ip(); $ip = get_client_ip();
// $isUSIP = ip_is_country($ip); $isUSIP = ip_is_country($ip);
$isUSIP = false; // $isUSIP = false;
// var_dump($isUSIP); // var_dump($isUSIP);
if(empty($data['user_id'])) { if(empty($data['user_id'])) {
re_msg(1004, 'fail', '用户不存在'); re_msg(1004, 'fail', '用户不存在');
@ -200,11 +200,16 @@ class GameController extends BaseController{
} }
} }
// var_dump($isUSIP); // var_dump($isUSIP);
if (/* isset($data['app_type']) && $data['app_type'] == 2 && */$isUSIP) { //判断是否开启苹果内购beta包美国ip且是否在白名单当中
if (!getAppleInteriorBuyStatus()) {
if($v['name'] == 'gift' || $v['name'] == 'suppersign') { if (isset($data['app_type']) && $data['app_type'] == 2 && $isUSIP) {
unset($menus[$k]);
continue; if (!getIpForbitWhiteList($data['user_id'])) {
if ($v['name'] == 'gift' || $v['name'] == 'suppersign') {
unset($menus[$k]);
continue;
}
}
} }
} }
@ -267,14 +272,19 @@ class GameController extends BaseController{
continue; continue;
} }
} }
if (/* isset($data['app_type']) && $data['app_type'] == 2 && */$isUSIP) { if (!getAppleInteriorBuyStatus()) {
if($v['name'] == 'gift' || $v['name'] == 'balance') { if (isset($data['app_type']) && $data['app_type'] == 2 && $isUSIP) {
unset($personalMenu[$k]);
continue; if (!getIpForbitWhiteList($data['user_id'])) {
if ($v['name'] == 'gift' || $v['name'] == 'balance') {
unset($personalMenu[$k]);
continue;
}
}
} }
} }
//测试账号苹果审核 //测试账号苹果审核
$personalMenu[$k]['icon'] = (substr($v['icon'], 0, 7) == "http://" || substr($v['icon'], 0, 8) == "https://" ) ? $v['icon'] : $personalMenu[$k]['icon'] = (substr($v['icon'], 0, 7) == "http://" || substr($v['icon'], 0, 8) == "https://" ) ? $v['icon'] :
C('ADMIN_DOMAIN') . $v['icon']; C('ADMIN_DOMAIN') . $v['icon'];

Loading…
Cancel
Save