master
ELF 5 years ago
parent e6f3329ac8
commit d3a3b8cdb7

@ -17,6 +17,7 @@ use BaiduBce\Services\Bos\CannedAcl;
use BaiduBce\Services\Bos\BosOptions;
use BaiduBce\Auth\SignOptions;
use BaiduBce\Log\LogFactory;
use Base\Service\GameService;
/**
* 后台首页控制器
@ -170,6 +171,15 @@ class GameController extends ThinkController
$this->error('游戏标示不能为空!');
exit;
}
$downloadWays = $_POST['download_ways'] ?? [];
if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) {
if (empty($_POST['beta_url'])) {
return $this->error("请在Beta按钮开启的情况填写Beta链接");
}
if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) {
return $this->error("请填写正确的Beta链接");
}
}
$_POST['relation_game_name'] = $_POST['game_name'];
if ($_POST['sdk_version'] == 1) {
unset($_POST['ios_game_address']);
@ -203,6 +213,10 @@ class GameController extends ThinkController
//$_POST['material_url'] = $_POST['file_url'].$_POST['file_name'];
$_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount'];
$_POST['short'] = $short;
$gameService = new GameService();
$_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays);
$game = D(self::model_name);//M('$this->$model_name','tab_');
$res = $game->update();
if (!$res) {
@ -299,15 +313,18 @@ class GameController extends ThinkController
exit;
}
if ($_POST['beta_status'] == 1 && empty($_POST['beta_url'])) {
return $this->error("请在Beta按钮开启的情况填写Beta链接");
}
if (!empty($_POST['beta_url']) && !preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) {
return $this->error("请填写正确的Beta链接");
$downloadWays = $_POST['download_ways'] ?? [];
if (in_array(GameService::DOWNLOAD_BETA, $downloadWays)) {
if (empty($_POST['beta_url'])) {
return $this->error("请在Beta按钮开启的情况填写Beta链接");
}
if (!preg_match("/^((https|http|itms-beta)?:\/\/)[^\s]+/i", $_POST['beta_url'])) {
return $this->error("请填写正确的Beta链接");
}
}
/*if($_POST['apply_status']==0&&$_POST['game_status']==1){
$this->error('游戏未审核不允许显示');//游戏添加完成
}*/
}*/
$_POST['introduction'] = str_replace(array("\r\n", "\r", "\n"), "~~", $_POST['introduction']);
if (!empty($_POST['display_site'])) {
@ -321,7 +338,10 @@ class GameController extends ThinkController
$_POST['discount'] == '' ? $_POST['discount'] = 10 : $_POST['discount'];
$_POST['detail_content'] = $content;
$_POST['pay_config'] = json_encode($_POST['pay_config']);
$gameService = new GameService();
$_POST['download_ways'] = $gameService->getDownLoadWaysValue($downloadWays);
$res = $game->update();
$id = $res["id"];
$sibling = D("Game")->find($id);
$map['relation_game_id'] = $sibling['relation_game_id'];
@ -356,9 +376,6 @@ class GameController extends ThinkController
$phone['back_map'] = $sibling['back_map'];
$phone['flooring_page_video'] = $sibling['flooring_page_video'];
$phone['flooring_page_video_cover'] = $sibling['flooring_page_video_cover'];
$phone['supersign_status'] = $sibling['supersign_status'];
$phone['beta_url'] = $_POST['beta_url'];
$phone['beta_status'] = $_POST['beta_status'];
M('Game', 'tab_')->data($phone)->where(array('id' => $another['id']))->save();
//同时修改代充游戏折扣
$set_fidel['status'] = 1;

@ -408,16 +408,39 @@
<tr>
<td class="l">超级签Token</td>
<td class="r" >
<input type="text" class="txt " name="supersign_token" value="" placeholder="请输入超级签Token" >
</td>
<td class="l">超级签Token</td>
<td class="r" >
<input type="text" class="txt " name="supersign_token" value="" placeholder="请输入超级签Token" >
</td>
</tr>
<tr>
<td class="l">超级签URL</td>
<td class="r" >
<input type="text" class="txt " name="supersign_url" value="" placeholder="请输入超级签URL" >
</td>
<td class="l">超级签URL</td>
<td class="r" >
<input type="text" class="txt " name="supersign_url" value="" placeholder="请输入超级签URL" >
</td>
</tr>
<tr class="ios-display" style="display: none;">
<td class="l" >Beta版本链接</td>
<td class="r" colspan="3">
<input type="text" class="txt " name="beta_url" value="" placeholder="请输入Bata版本下载链接">
</td>
</tr>
<tr class="ios-display" style="display: none;">
<td class="l">下载方式</td>
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="checkbox" class="inp_radio" value="1" name="download_ways[]"> 至尊下载
</label>
<label>
<input type="checkbox" class="inp_radio" value="2" name="download_ways[]"> beta版下载
</label>
<label>
<input type="checkbox" class="inp_radio" value="4" name="download_ways[]"> 普通下载
</label>
</span>
</td>
</tr>
</tbody>
</table>
@ -1284,9 +1307,11 @@
$("input[name='appstatus'][value=1]").prop("disabled",true);
$("input[name='appstatus'][value=0]").prop("disabled",true);
$("input[name='appstatus'][value=0]").prop("checked",true);
$('.ios-display').hide();
}else{
$("input[name='appstatus'][value=1]").removeAttr("disabled");
$("input[name='appstatus'][value=0]").removeAttr("disabled");
$('.ios-display').show();
}
})

@ -446,28 +446,6 @@
</if>
</tr>
<tr>
<td class="l" >Beta版本链接</td>
<td class="r" colspan="3">
<input type="text" class="txt " name="beta_url" value="{$data['beta_url']}" placeholder="请输入Bata版本下载链接">
</td>
</tr>
<tr>
<td class="l">Beta版本是否开启</td>
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="beta_status" <?php if ($data['beta_status'] == 0):?>checked='checked'<?php endif;?> > 关闭
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="beta_status" <?php if ($data['beta_status'] == 1):?>checked='checked'<?php endif;?> > 开启
</label>
</span>
</td>
</tr>
<notempty name="data.accredit_img">
<tr class="picbox">
<td class="l noticeinfo">知识产权</td>
@ -569,6 +547,7 @@
<td class="r"><input type="text" class="txt2" id="game_address_size" value="{$data['game_address_size']}" name="game_address_size" placeholder="请输入第三方原包大小"> </td>
</tr>
<?php if($data['sdk_version'] == 2):?>
<tr>
<td class="l">超级签Token</td>
<td class="r" >
@ -581,32 +560,29 @@
<input type="text" class="txt " name="supersign_url" value="{$data['supersign_url']}" placeholder="请输入超级签URL" >
</td>
</tr>
<tr>
<td class="l">超级签状态:</td>
<if condition="$data['supersign_status'] eq 1">
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="supersign_status" > 关闭
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="supersign_status" checked="checked"> 开启
</label></span>
</td>
<else/>
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="radio" class="inp_radio" value="0" name="supersign_status" checked="checked"> 关闭
</label>
<label>
<input type="radio" class="inp_radio" value="1" name="supersign_status" > 开启
</label></span>
</td>
</if>
<td class="l" >Beta版本链接</td>
<td class="r" colspan="3">
<input type="text" class="txt " name="beta_url" value="{$data['beta_url']}" placeholder="请输入Bata版本下载链接">
</td>
</tr>
<tr>
<td class="l">下载方式</td>
<td class="r" >
<span class="form_radio table_btn">
<label>
<input type="checkbox" class="inp_radio" value="4" name="download_ways[]" <?php if(($data['download_ways'] & 4) == 4):?>checked<?php endif;?>> 至尊下载
</label>
<label>
<input type="checkbox" class="inp_radio" value="2" name="download_ways[]" <?php if(($data['download_ways'] & 2) == 2):?>checked<?php endif;?>> beta版下载
</label>
<label>
<input type="checkbox" class="inp_radio" value="1" name="download_ways[]" <?php if(($data['download_ways'] & 1) == 1):?>checked<?php endif;?>> 普通下载
</label>
</span>
</td>
</tr>
<?php endif;?>
</tbody>
</table>
</div>

@ -0,0 +1,19 @@
<?php
namespace Base\Service;
use Base\Facade\Request;
class GameService {
const DOWNLOAD_SUPER = 4;
const DOWNLOAD_BETA = 2;
const DOWNLOAD_NORMAL = 1;
public function getDownLoadWaysValue(array $downloadWays)
{
$value = 0;
foreach ($downloadWays as $downloadWay) {
$value |= $downloadWay;
}
return $value;
}
}

@ -186,10 +186,9 @@ class HomeController extends Controller
'introduction',
'flooring_page_video',
'flooring_page_video_cover',
'supersign_status',
'ios_video_top',
'beta_status',
'beta_url',
'download_ways'
];
$map = ['id' => intval($gameId)];
$game = M('game', 'tab_')->field($columns)->where($map)->find();

@ -33,7 +33,6 @@
<input type="hidden" name="desc" value="{$game['features']}">
<input type="hidden" name="isIOS13" value="<?php if($isIOS13):?>1<?php else:?>0<?php endif;?>">
<input type="hidden" name="isNewIos" value="<?php if($isNewIos):?>1<?php else:?>0<?php endif;?>">
<input type="hidden" name="supersign_status" value="{$game['supersign_status']}" id="supersign_status">
<input type="hidden" name="betaUrl" value="{$game['beta_url']}">
<?php if ($isWechat):?>
@ -104,11 +103,7 @@
<div>{$game['relation_game_name']}</div>
<div>{$game['features']}</div>
<div>
<?php if ($downloadUrl == 'https://'.$_SERVER['HTTP_HOST']) :?>
<div class="download">免费安装</div>
<?php else :?>
<div class="download">免费安装</div>
<?php endif ;?>
<div class="download" data-downloadable="<?= ($game['dow_status'] != 1 || $game['download_ways'] == 0) ? 0 : 1 ?>">免费安装</div>
<img src="__IMG__/wenhao.png" class="doubt" alt="">
</div>
</div>
@ -259,25 +254,31 @@
<div class="window" style="display: none;z-index: 1000">
<div class="containner">
<div class="containner-box">
<div class="text"> 购买至尊下载赠送限量至尊超级礼包价值100元</div>
<div class="text">• 至尊下载:永不闪退、不丢数据稳定有保障</div>
<div class="text"> • 同一设备安装一次可在一年内无限次下载重装</div>
<div style="display: flex;flex-direction: column;align-items: center;justify-content: center;height: 2.6rem;">
<?php if (($game['download_ways'] & 2) == 2):?>
<div class="text">beta版下载免费下载解决您频繁掉签的烦恼</div>
<?php endif;?>
<?php if (($game['download_ways'] & 4) == 4):?>
<div class="text">至尊下载10元购买永不闪退、不丢数据稳定与保障。同意设备安装一次可在一年内无限次下载重装并赠送限量至尊超级礼包</div>
<?php endif;?>
<?php if (($game['download_ways'] & 1) == 1):?>
<div class="text">普通下载:免费下载,畅游手游世界!</div>
<?php endif;?>
</div>
<?php if ($game['dow_status'] ==1):?>
<?php if ($game['supersign_status'] ==1):?>
<div class="blue-btn" onclick="location.href='mobile.php/Ssg/pay/game_id/{$game[\'id\']}/promote_id/{$promoteId}'">¥10至尊下载</div>
<?php else:?>
<div class="blue-btn" onclick="layer.msg('已售空,我们正在努力上货中~');">¥10至尊下载</div>
<?php if (($game['download_ways'] & 2) == 2):?>
<div class="blue-btn stabilization" data-url="{$game['beta_url']}">beta版下载</div>
<?php endif;?>
<?php if ($game['beta_status'] == 1):?>
<div class="blue-btn stabilization" data-url="{$game['beta_url']}">beta版下载</div>
<?php else:?>
<div class="blue-btn" onclick="layer.msg('已售空,我们正在努力上货中~');">beta版下载</div>
<?php if (($game['download_ways'] & 4) == 4):?>
<div class="blue-btn" onclick="location.href='mobile.php/Ssg/pay/game_id/{$game[\'id\']}/promote_id/{$promoteId}'">¥10至尊下载</div>
<?php endif;?>
<?php if (($game['download_ways'] & 1) == 1):?>
<div class="blue-btn down-link" down-link="{$downloadUrl}">普通下载</div>
<?php endif;?>
<?php else:?>
<div class="blue-btn" onclick="layer.msg('该游戏已关闭下载');">¥10至尊下载</div>
@ -1076,11 +1077,16 @@ var PhoneObj = {
};
swiperGet();
$(".download").click(function(){
var isTipSafari = is_tip_safari();
if (isTipSafari) {
$('.safari').show();
return;
}
var downloadable = $(this).attr('data-downloadable');
if (downloadable == 0) {
return layer.msg('暂无下载');
}
$(".window").show();
document.body.style.overflow = 'hidden';
});

@ -325,9 +325,11 @@ class SsgController extends BaseController {
}
$map["sdk_version"] = 2;
$map["game_status"] = 1;
$map["supersign_status"] = 1;
$game_list = M("game", "tab_")->field("*, id as game_id")->where($map)->select();
for ($i=0; $i < count($game_list); $i++) {
if ($game_list[$i]['download_ways'] & GameService::DOWNLOAD_SUPER != GameService::DOWNLOAD_SUPER) {
continue;
}
$game_list[$i]["game_icon"] = get_cover($game_list[$i]["icon"], 'path');
}
$res = array("list"=>$game_list);

@ -1089,4 +1089,8 @@ ADD COLUMN `relation_game_id` int(11) NOT NULL DEFAULT 0 COMMENT '关联游戏id
ALTER TABLE `tab_spend`
MODIFY COLUMN `selle_status` int(11) NOT NULL DEFAULT 0 COMMENT '渠道结算 0未结算1 结算',
MODIFY COLUMN `selle_ratio` double(5, 2) DEFAULT 0.00 COMMENT '渠道分成比例';
MODIFY COLUMN `selle_ratio` double(5, 2) DEFAULT 0.00 COMMENT '渠道分成比例';
ALTER TABLE `tab_game`
ADD COLUMN `download_ways` tinyint(3) NOT NULL DEFAULT 0 COMMENT '下载方式' AFTER `beta_url`;

@ -405,7 +405,7 @@
}
.containner{
width: 5.50rem;
height: 7.82rem;
height: 9.20rem;
background: url(../images/landing_bg.png) no-repeat;
background-size: 100% 100%;
display: flex;
@ -423,6 +423,7 @@
font-weight:400;
color:rgba(41,41,41,1);
line-height:0.36rem;
width: 100%;
}
.blue-btn{
width: 4.40rem;

Loading…
Cancel
Save