Merge branch 'master' of 8.136.139.249:wmtx/platform into feature/more_payment

master
chenzhi 4 years ago
commit 79c52576c2

@ -505,6 +505,14 @@ class PaymentMerchantController extends ThinkController
$weixinMerchants = $paymentMerchantService->getMerchantsByWay(PaymentMerchantService::WAY_WEIXIN); $weixinMerchants = $paymentMerchantService->getMerchantsByWay(PaymentMerchantService::WAY_WEIXIN);
$expressMerchants = $paymentMerchantService->getMerchantsByWay(PaymentMerchantService::WAY_EXPRESS); $expressMerchants = $paymentMerchantService->getMerchantsByWay(PaymentMerchantService::WAY_EXPRESS);
$companies = $companyService->getCompanies(null, 'id,company_name'); $companies = $companyService->getCompanies(null, 'id,company_name');
$defaultExpress = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_EXPRESS);
$defaultAlipay = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_ALIPAY);
$defaultWeixin = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_WEIXIN);
$this->assign('defaultExpress', $defaultExpress ? $defaultExpress['name'] . '(' . $defaultExpress['account'] . ')' : '无');
$this->assign('defaultAlipay', $defaultAlipay ? $defaultAlipay['name'] . '(' . $defaultAlipay['account'] . ')' : '无');
$this->assign('defaultWeixin', $defaultWeixin ? $defaultWeixin['name'] . '(' . $defaultWeixin['account'] . ')' : '无');
$this->assign('aliMerchants', $aliMerchants); $this->assign('aliMerchants', $aliMerchants);
$this->assign('weixinMerchants', $weixinMerchants); $this->assign('weixinMerchants', $weixinMerchants);
$this->assign('expressMerchants', $expressMerchants); $this->assign('expressMerchants', $expressMerchants);
@ -604,6 +612,14 @@ class PaymentMerchantController extends ThinkController
$rule ['start_time'] = $rule ['start_time'] == 0 ? '' : date('Y-m-d', $rule ['start_time']); $rule ['start_time'] = $rule ['start_time'] == 0 ? '' : date('Y-m-d', $rule ['start_time']);
$rule ['end_time'] = $rule ['end_time'] == PaymentRuleService::FOREVER_TIME ? '' : date('Y-m-d', $rule ['end_time']); $rule ['end_time'] = $rule ['end_time'] == PaymentRuleService::FOREVER_TIME ? '' : date('Y-m-d', $rule ['end_time']);
$defaultExpress = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_EXPRESS);
$defaultAlipay = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_ALIPAY);
$defaultWeixin = $paymentMerchantService->getDefault(PaymentMerchantService::WAY_WEIXIN);
$this->assign('defaultExpress', $defaultExpress ? $defaultExpress['name'] . '(' . $defaultExpress['account'] . ')' : '无');
$this->assign('defaultAlipay', $defaultAlipay ? $defaultAlipay['name'] . '(' . $defaultAlipay['account'] . ')' : '无');
$this->assign('defaultWeixin', $defaultWeixin ? $defaultWeixin['name'] . '(' . $defaultWeixin['account'] . ')' : '无');
$this->assign('aliMerchants', $aliMerchants); $this->assign('aliMerchants', $aliMerchants);
$this->assign('weixinMerchants', $weixinMerchants); $this->assign('weixinMerchants', $weixinMerchants);
$this->assign('expressMerchants', $expressMerchants); $this->assign('expressMerchants', $expressMerchants);

@ -150,10 +150,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>支付宝支付配置:</td> <td class="l"><i class="mustmark">*</i>支付宝支付配置:</td>
<td class="r"> <td class="r">
<select name="alipay_merchant_id" id="alipay-merchant-select" class="select_gallery"> <select name="alipay_merchant_id" id="alipay-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultAlipay?></option>
<?php foreach($aliMerchants as $merchant):?> <?php foreach($aliMerchants as $merchant):?>
<option value="<?=$merchant['id']?>"><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>"><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>
@ -161,10 +161,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>微信支付配置:</td> <td class="l"><i class="mustmark">*</i>微信支付配置:</td>
<td class="r"> <td class="r">
<select name="weixin_merchant_id" id="weixin-merchant-select" class="select_gallery"> <select name="weixin_merchant_id" id="weixin-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultWeixin?></option>
<?php foreach($weixinMerchants as $merchant):?> <?php foreach($weixinMerchants as $merchant):?>
<option value="<?=$merchant['id']?>"><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>"><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>
@ -172,10 +172,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>快捷支付配置:</td> <td class="l"><i class="mustmark">*</i>快捷支付配置:</td>
<td class="r"> <td class="r">
<select name="express_merchant_id" id="express-merchant-select" class="select_gallery"> <select name="express_merchant_id" id="express-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultExpress?></option>
<?php foreach($expressMerchants as $merchant):?> <?php foreach($expressMerchants as $merchant):?>
<option value="<?=$merchant['id']?>"><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>"><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>

@ -150,10 +150,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>支付宝支付配置:</td> <td class="l"><i class="mustmark">*</i>支付宝支付配置:</td>
<td class="r"> <td class="r">
<select name="alipay_merchant_id" id="alipay-merchant-select" class="select_gallery"> <select name="alipay_merchant_id" id="alipay-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultAlipay?></option>
<?php foreach($aliMerchants as $merchant):?> <?php foreach($aliMerchants as $merchant):?>
<option value="<?=$merchant['id']?>" <?php if($record['alipay_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>" <?php if($record['alipay_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>
@ -161,10 +161,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>微信支付配置:</td> <td class="l"><i class="mustmark">*</i>微信支付配置:</td>
<td class="r"> <td class="r">
<select name="weixin_merchant_id" id="weixin-merchant-select" class="select_gallery"> <select name="weixin_merchant_id" id="weixin-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultWeixin?></option>
<?php foreach($weixinMerchants as $merchant):?> <?php foreach($weixinMerchants as $merchant):?>
<option value="<?=$merchant['id']?>" <?php if($record['weixin_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>" <?php if($record['weixin_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>
@ -172,10 +172,10 @@
<tr> <tr>
<td class="l"><i class="mustmark">*</i>快捷支付配置:</td> <td class="l"><i class="mustmark">*</i>快捷支付配置:</td>
<td class="r"> <td class="r">
<select name="express_merchant_id" id="express-merchant-select" class="select_gallery"> <select name="express_merchant_id" id="express-merchant-select" class="select_gallery" style="width: 450px;">
<option value="0">跟随系统默认商户</option> <option value="0">跟随系统默认商户<?=$defaultExpress?></option>
<?php foreach($expressMerchants as $merchant):?> <?php foreach($expressMerchants as $merchant):?>
<option value="<?=$merchant['id']?>" <?php if($record['express_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?></option> <option value="<?=$merchant['id']?>" <?php if($record['express_merchant_id']==$merchant['id']):?>selected<?php endif;?>><?=$merchant['name']?>(<?=$merchant['account']?>)</option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
</td> </td>

@ -77,19 +77,23 @@ class ApplyService {
return M('Apply', 'tab_')->save($data); return M('Apply', 'tab_')->save($data);
} }
public function getDownloadUrl($apply) public function getDownloadUrl($apply, $code = null)
{ {
$host = $this->getDownloadDomain(); $host = $this->getDownloadDomain();
$host = $host ? $host : Request::getHost(); $host = $host ? $host : Request::getHost();
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD); if (!$code) {
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD);
}
return $host . '/index.php?s=/Home/Package/download/code/' . $code; return $host . '/index.php?s=/Home/Package/download/code/' . $code;
} }
public function getLandingPageUrl($apply) public function getLandingPageUrl($apply, $code = null)
{ {
$host = $this->getDownloadDomain(); $host = $this->getDownloadDomain();
$host = $host ? $host : Request::getHost(); $host = $host ? $host : Request::getHost();
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_LANDING_PAGE); if (!$code) {
$code = $this->encodeApplyCode($apply, self::ENCRYPT_TYPE_DOWNLOAD);
}
return $host . '/index.php?s=/Home/Home/landingPage/code/' . $code; return $host . '/index.php?s=/Home/Home/landingPage/code/' . $code;
} }
@ -171,12 +175,12 @@ class ApplyService {
'message' => '参数异常', 'message' => '参数异常',
]; ];
} }
if ($data['type'] != $type) { /* if ($data['type'] != $type) {
return [ return [
'status' => false, 'status' => false,
'message' => '参数异常', 'message' => '参数异常',
]; ];
} } */
if ($data['expires_in'] > 0 && time() > (strtotime($data['created_at']) + $data['expires_in'])) { if ($data['expires_in'] > 0 && time() > (strtotime($data['created_at']) + $data['expires_in'])) {
return [ return [
'status' => false, 'status' => false,

@ -312,7 +312,7 @@ class HomeController extends Controller
if (!$isNewIos && $isIOS13) { if (!$isNewIos && $isIOS13) {
$downloadUrl = 'itms-services://?action=download-manifest&url=' . Request::getHost() . ltrim($gameSource['org_plist_url'], '.'); $downloadUrl = 'itms-services://?action=download-manifest&url=' . Request::getHost() . ltrim($gameSource['org_plist_url'], '.');
} else { } else {
$downloadUrl = $applyService->getDownloadUrl($apply); $downloadUrl = $applyService->getDownloadUrl($apply, $code);
if ($force) { if ($force) {
$downloadUrl .= '/force/' . $force; $downloadUrl .= '/force/' . $force;
} }

@ -69,36 +69,40 @@ class PackageController extends Controller
$this->error('链接已失效'); $this->error('链接已失效');
} }
$sdkVersion = 0;
if (Request::isMobile() || Request::isTablet() || $force == 'ios' || $force == 'android') {
if (Request::isAndroid() || $force == 'android') {
$sdkVersion = 1;
} elseif (Request::isIOS() || Request::isIPadOS() || $force == 'ios') {
$sdkVersion = 2;
}
}
$gameColumns = ['id', 'game_name', 'sdk_version', 'apply_auth', 'relation_game_id'];
$game = M('game','tab_')->field($gameColumns)->where(['id' => $gameId])->find();
if ($sdkVersion > 0 && $game && $game['sdk_version'] != $sdkVersion) {
$game = M('game','tab_')->field($gameColumns)->where(['sdk_version' => $sdkVersion, 'relation_game_id' => $game['relation_game_id']])->find();
}
if (!$game) {
$this->error('游戏不存在');
}
$map = []; $map = [];
$map['status'] = 1; $map['status'] = 1;
$map['enable_status'] = 1; $map['enable_status'] = 1;
$map['game_id'] = $gameId; $map['game_id'] = $game['id'];
$map['promote_id'] = $promoteId; $map['promote_id'] = $promoteId;
$columns = ['game_id', 'promote_id', 'promote_account', 'pack_url', 'plist_url', 'status', 'enable_status']; $apply = M('apply','tab_')->where($map)->find();
$apply = M('apply','tab_')->field($columns)->where($map)->find();
if (!$apply) { if (!$apply) {
$this->redirect("package/downloadError", ['message' => '该链接已经停止使用']); $this->redirect("package/downloadError", ['message' => '该链接已经停止使用']);
} }
$game = M('game','tab_')->field(['id', 'game_name', 'sdk_version', 'apply_auth'])->where(['id' => $apply['game_id']])->find();
if (Request::isMobile() || Request::isTablet() || $force == 'ios' || $force == 'android') {
if (!(Request::isAndroid() || $force == 'android') && $game['sdk_version'] == 1) {
$this->redirect("package/downloadError", ['message' => '请使用安卓浏览器下载']);
}
if (!(Request::isIOS() || Request::isIPadOS() || $force == 'ios') && $game['sdk_version'] == 2) {
$this->redirect("package/downloadError", ['message' => '请使用ios浏览器下载']);
}
}
$packageUrl = $game['sdk_version'] == 1 ? $apply['pack_url'] : $apply['plist_url']; $packageUrl = $game['sdk_version'] == 1 ? $apply['pack_url'] : $apply['plist_url'];
$apply = M('apply', 'tab_')->where(['promote_id' => $promoteId, 'game_id' => $gameId])->find(); $url = $applyService->getLandingPageUrl($apply, $code);
$url = $applyService->getLandingPageUrl($apply);
M('game','tab_')->where(['id' => $game['id']])->setInc('dow_num'); M('game','tab_')->where(['id' => $game['id']])->setInc('dow_num');
$log['game_id'] = $game['id'];
$log['game_id'] = $gameId;
$log['game_name'] = $game['game_name']; $log['game_name'] = $game['game_name'];
$log['action'] = $url; $log['action'] = $url;
$log['type'] = 6; $log['type'] = 6;
@ -109,11 +113,14 @@ class PackageController extends Controller
M('user_action_log', 'tab_')->data($log)->add(); M('user_action_log', 'tab_')->data($log)->add();
$downloadDomain = $applyService->getDownloadDomain(); $downloadDomain = $applyService->getDownloadDomain();
if (Request::isIOS() || Request::isIPadOS() || $force == 'ios') { if ($game['sdk_version'] == 2) {
/* if (!Request::getMobileDetect()->is('Safari')) {
return $this->display('open_in_safari');
} */
$packageDownloadLogService = new PackageDownloadLogService(); $packageDownloadLogService = new PackageDownloadLogService();
$packageDownloadLogService->add([ $packageDownloadLogService->add([
'user_id' => 0, 'user_id' => 0,
'game_id' => $gameId, 'game_id' => $game['id'],
'promote_id' => $promoteId, 'promote_id' => $promoteId,
'type' => 1, 'type' => 1,
]); ]);

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta itemprop="name" content="请在Safari浏览器中打开"/>
<meta name="description" itemprop="description" content="请在Safari浏览器中打开"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
<meta content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="{:get_cover(C('CH_SET_ICO'),'path')}" type="image/x-icon" rel="shortcut icon">
<script src="__JS__/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script type="text/javascript" src="__JS__/getRem.js"></script>
<script type="text/javascript" src="__JS__/swiper.min.js"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/swiper.min.css">
<link rel="stylesheet" type="text/css" href="__CSS__/reset.css">
<link rel="stylesheet" type="text/css" href="__CSS__/index2.css">
<link rel="stylesheet" type="text/css" href="__CSS__/giftbag.css">
<script src="__STATIC__/bg4_4.js"></script>
<title>请在Safari浏览器中打开</title>
</head>
<body>
<div class="safari" style="z-index: 1000">
<div class="safari-heard">
<div>请选择在“Safari”中打开</div>
<img src="__IMG__/arror.png" alt="">
</div>
<div class="safari-info">
<img src="__IMG__/safari.png" alt="">
<div>
<div>该链接只支持<a href="#">Safari</a></div>
<div>请在<a href="#">Safari</a>中打开</div>
</div>
</div>
</div>
</body>
</html>
Loading…
Cancel
Save