Merge branch 'dev'

master
ELF 5 years ago
commit 9b3dce6918

@ -54,6 +54,39 @@ class PlistController extends ThinkController {
} }
public function create_org_plist($game_id=0,$promote_id=0,$marking="",$url=""){
$xml = new \DOMDocument();
$xml->load('./Uploads/Plist/testdemo.Plist');
$online = $xml->getElementsByTagName('dict');//查找节点
$asd=$online->item(1)->getElementsByTagName('string');//第二个节点下所有string
foreach ($asd as $key=>$value) {
switch ($value->textContent) {
case 'ipa_url':
if(preg_match("/Uploads/", $url)){
$value->nodeValue="https://".$_SERVER['HTTP_HOST'].ltrim($url,".");//"https://iosdemo.vlcms.com/app/MCHSecretary.ipa";//替换xml对应的值
}else{
$value->nodeValue=$url;
}
break;
case 'icon':
$value->nodeValue="https://".$_SERVER["HTTP_HOST"].get_cover(get_game_icon_id($game_id),'path');;
break;
case 'com.dell':
$value->nodeValue=$marking;
break;
case '1.0.0':
$value->nodeValue=game_version($game_id);
break;
case 'mchdemo':
$value->nodeValue=get_ios_game_name($game_id);
break;
}
$xml->save("./Uploads/OrgSourcePlist/$game_id.Plist");
}
return "./Uploads/OrgSourcePlist/$game_id.Plist";
}
//生成App plist文件 //生成App plist文件
public function create_plist_app($version="",$app_id=0,$marking="",$url="", $promote_id=0){ public function create_plist_app($version="",$app_id=0,$marking="",$url="", $promote_id=0){

@ -41,6 +41,7 @@ class SourceEvent extends Controller
$data['remark'] = json_encode(explode('@@@', $remark)); $data['remark'] = json_encode(explode('@@@', $remark));
if ($data['file_type'] == 2) { if ($data['file_type'] == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']); $plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']);
} }
$res = $model -> add($data); $res = $model -> add($data);
@ -100,6 +101,7 @@ class SourceEvent extends Controller
} }
if ($data['file_type'] == 2) { if ($data['file_type'] == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']); $plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']);
} }
$data['source_version'] = $game_source['source_version'] + 1; $data['source_version'] = $game_source['source_version'] + 1;
@ -265,6 +267,7 @@ class SourceEvent extends Controller
if ($file_type == 2) { if ($file_type == 2) {
$data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist";
$plist -> create_plist($game_id, 0, $baoName, $to); $plist -> create_plist($game_id, 0, $baoName, $to);
$plist -> create_org_plist($game_id, 0, $baoName, $originalUrl);
} }
} }

@ -142,12 +142,18 @@ class HomeController extends Controller
{ {
$gameId = I('get.gid'); $gameId = I('get.gid');
$promoteId = I('get.pid'); $promoteId = I('get.pid');
$status = I('get.status');
if (empty($gameId) || empty($promoteId)) { if (empty($gameId) || empty($promoteId)) {
$this->error('链接丢失'); $this->error('链接丢失');
} }
$downLink = get_apply_dow_url($gameId, $promoteId); if ($status == 1) {
$downLink = 'itms-services://?action=download-manifest&url=' . 'https://' . C('APPLY_DOWN_DOMAIN') . M('Apply', 'tab_')->where(array('promote_id'=>$promoteId,'game_id'=>$gameId))->getField('original_url');
} else {
$downLink = get_apply_dow_url($gameId, $promoteId);
}
$this->assign('downLink', $downLink); $this->assign('downLink', $downLink);
$this->display(); $this->display();
} }

@ -120,6 +120,8 @@
setTimeout(function () { setTimeout(function () {
var url = "{$downLink}"; var url = "{$downLink}";
console.log(url);
return false;
window.location.href = url; window.location.href = url;
}, 500); }, 500);
} }

@ -64,6 +64,66 @@
margin-top: 21px; margin-top: 21px;
width: 100%; width: 100%;
} }
.register-box-max {
width: 80%;
height: 40%;
top: 30%;
left: 10%;
position: fixed;
z-index: 10;
background-color: #fff;
border-radius: 10px;
}
.register-bg {
width: 100%;
height: inherit;
position: fixed;
background-color: #0a0a0a;
opacity: 0.5;
}
.register-title-box {
padding: 10px 10px;
margin-top: 10px;
text-align: center;
font-size: 1.2rem;
}
.register-title-box span {
font-weight: 600;
}
.register-input-box {
text-align: center;
font-size: 1rem;
}
.register-input-box input {
width: calc(80% - 5px);
height: 2rem;
padding-left: 5px;
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #6f6f6f;
border-radius: 3px;
}
.register-btn-box {
margin-top: 40px;
text-align: center;
}
.register-btn-box button {
width: 80%;
height: 2.5rem;
border: 0;
border-radius: 5px;
background-color: #1993ff;
color: #fff;
font-size: 1.1rem;
}
</style> </style>
</head> </head>
@ -73,6 +133,20 @@
<input type="hidden" name="desc" value="{$data[0]['features']}"> <input type="hidden" name="desc" value="{$data[0]['features']}">
<div class="bn-rule" style="display: none;"><img id="rule-img" src=""></div> <div class="bn-rule" style="display: none;"><img id="rule-img" src=""></div>
<!--<div class="register-box-max">-->
<!-- <div class="register-title-box">-->
<!-- <span>注册</span>-->
<!-- </div>-->
<!-- <div class="register-input-box">-->
<!-- <input value="" placeholder="账号">-->
<!-- <input value="" placeholder="密码">-->
<!-- </div>-->
<!-- <div class="register-btn-box">-->
<!-- <button>注册</button>-->
<!-- </div>-->
<!--</div>-->
<!--<div class="register-bg"></div>-->
<div class="h_wrap"> <div class="h_wrap">
<notempty name="data[0]['flooring_page_imgs']"> <notempty name="data[0]['flooring_page_imgs']">
<div id="data-1" style="display: none;"> <div id="data-1" style="display: none;">
@ -116,7 +190,6 @@
</div> </div>
</notempty> </notempty>
<div class="h_title_box ta_c p_t_15"> <div class="h_title_box ta_c p_t_15">
<script src="__STATIC__/layer/layer.js"></script> <script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script> <script src="__STATIC__/ios9/js/layer/layer.js?VerNo=20190923" type="text/javascript"></script>
@ -136,6 +209,17 @@
} }
} else { } else {
if (is_ios()) { if (is_ios()) {
if (!Boolean(navigator.userAgent.match(/OS [1][3]_[1][_\d]* like Mac OS X/i)) && !parseInt("{:I('get.status')}")) {
if (!parseInt("{:I('get.status')}")) {
layer.confirm('请先到官网注册',{title:''} , function () {
location.href = "/mobile.php?s=/User/login/pid/" + "{:I('get.pid')}" + "/gid/" + "{:I('get.gid')}" + ".html";
});
return false;
} else {
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid'),'status'=>1))}";
}
}
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid')))}"; location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid')))}";
} else { } else {
var downLink = $(this).attr('down-link'); var downLink = $(this).attr('down-link');

@ -32,7 +32,6 @@ class UserController extends BaseController {
/*是否开启Ucenter*/ /*是否开启Ucenter*/
if( C('UC_OPEN')==1 ){ if( C('UC_OPEN')==1 ){
$username = $account; $username = $account;
//Ucenter登录 //Ucenter登录
@ -142,13 +141,57 @@ class UserController extends BaseController {
} }
} }
$res = $this->suser->login($account,$password);file_put_contents(dirname(__FILE__) . '/login_res_text.txt',json_encode([$res])); $res = $this->suser->login($account,$password);file_put_contents(dirname(__FILE__) . '/login_res_text.txt',json_encode([$res]));
if($res > 0) { if($res > 0) {
$data=array( $promoteId = I('post.promote_id');
'status' => 1, $promoteId = intval($promoteId);
'msg' => '登录成功',
); if ($promoteId > 0) {
$wherePromote['id'] = $promoteId;
$promoteData = M('Promote','tab_')->field('id,account')->where($wherePromote)->find();
if (!empty($promoteData)) {
$whereUser['account'] = $account;
$whereUser['_logic'] = 'or';
$whereUser['mobile_phone'] = $account;
$userData = M('User', 'tab_')->where($whereUser)->find();
if (!empty($userData)) {
if (empty($userData['promote_id'])) {
$saveData['promote_id'] = $promoteId;
$saveData['promote_account'] = $promoteData['account'];
$saveRes = M('User', 'tab_')->where(array('id'=>$userData['id']))->save($saveData);
if ($saveRes) {
$data = array(
'status' => 2,
'msg' => '登录成功!绑定成功',
);
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
);
}
} else {
$data=array(
'status' => 1,
'msg' => '登录成功',
);
}
} else { } else {
switch($res) { switch($res) {
case -1000: $error = '账号不存在'; break; case -1000: $error = '账号不存在'; break;
@ -190,9 +233,18 @@ class UserController extends BaseController {
if (empty($password)) { if (empty($password)) {
echo json_encode(array('status'=>0,'msg'=>'请输入密码'));exit; echo json_encode(array('status'=>0,'msg'=>'请输入密码'));exit;
} }
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
$promoteId = I('post.promote_id');
$promoteId = intval($promoteId);
if ($promoteId > 0) {
$gameId = intval(I('post.game_id'));
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1,'promote_id' => $promoteId, 'game_id' => $gameId);
} else {
$safeinfo = array('nickname' => $account, 'password' => $password, 'sex' => $sex ,'status' => 1);
}
session('safeinfo',$safeinfo); session('safeinfo',$safeinfo);
$url = U('register'); $url = U('register');
echo json_encode(array('status'=>1,'msg'=>$url)); echo json_encode(array('status'=>1,'msg'=>$url));
} else{ } else{
$this->display(); $this->display();
@ -275,11 +327,19 @@ class UserController extends BaseController {
$pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,'','',$sex,$nickname,$head_img); $pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,'','',$sex,$nickname,$head_img);
} }
if($pid > 0){ if($pid > 0){
$data = array( if (empty($safeinfo['promote_id'])) {
'status' => 1, $data = array(
'msg' => '注册成功', 'status' => 1,
'url' => U('Index/index'), 'msg' => '注册成功',
); 'url' => U('Index/index'),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $safeinfo['promote_id'], 'gid' => $safeinfo['game_id'])),
);
}
session('safeinfo',null); session('safeinfo',null);
} else{ } else{
$data = array( $data = array(
@ -369,14 +429,28 @@ class UserController extends BaseController {
if($is_setting){ if($is_setting){
echo json_encode(array('status'=>0,'msg'=>'账号已存在'));exit; echo json_encode(array('status'=>0,'msg'=>'账号已存在'));exit;
} }
$pid = $this->suser->register($account,$password,'',$register_way,$register_type,'','',$sex,$nickname,$head_img); $pid = $this->suser->register($account,$password,'',$register_way,$register_type,'','',$sex,$nickname,$head_img);
if($pid > 0){ if($pid > 0){
$data = array( $promoteId = I('post.promote_id');
'status' => 1, $promoteId = intval($promoteId);
'msg' => '注册成功',
'url' => U('Index/index'), if ($promoteId > 0) {
); $gameId = intval(I('post.game_id'));
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('User/login', array('pid' => $promoteId, 'gid' => $gameId)),
);
} else {
$data = array(
'status' => 1,
'msg' => '注册成功',
'url' => U('Index/index'),
);
}
} else{ } else{
$data = array( $data = array(
'status' => $pid, 'status' => $pid,

@ -68,7 +68,13 @@
<input type="button" class="submit" value="登录"> <input type="button" class="submit" value="登录">
</div> </div>
<div class="link-group clearfix"> <div class="link-group clearfix">
<?php if (empty(I('get.pid'))) {?>
<a href="{:U('User/step1')}" class="register-btn">账号注册 <font class="line">|</font> </a><a href="{:U('User/step')}" class="register-btn">&nbsp;手机注册</a> <a href="{:U('User/step1')}" class="register-btn">账号注册 <font class="line">|</font> </a><a href="{:U('User/step')}" class="register-btn">&nbsp;手机注册</a>
<?php } else {?>
<a href="<?='mobile.php?s=/User/step1/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">账号注册 <font class="line">|</font> </a>
<a href="<?='mobile.php?s=/User/step/pid/'.I('get.pid').'/gid/'.I('get.gid').'.html'?>" class="register-btn">&nbsp;手机注册</a>
<?php }?>
<a href="{:U('User/forget')}" class="forget-btn" style="color: #333">忘记密码</a> <a href="{:U('User/forget')}" class="forget-btn" style="color: #333">忘记密码</a>
</div> </div>
</form> </form>
@ -149,15 +155,17 @@
$('.submit').click(function(event) { $('.submit').click(function(event) {
var mobile = $.trim($('#mobile').val()); var mobile = $.trim($('#mobile').val());
var password = $.trim($('#password').val()); var password = $.trim($('#password').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if (mobile) { if (mobile) {
if (password) { if (password) {
$.ajax({ $.ajax({
type:'POST', type:'POST',
url:'{:U("login")}', url:'{:U("login")}',
data:{'phone':mobile,'password':password}, data:{'phone':mobile,'password':password,'promote_id':promoteId,'game_id':gameId},
dataType:"Json", dataType:"Json",
success:function(data){ success:function(data){
if(data.status == 1){ if(data.status == 1 || data.status == 2){
var username = lwx.getItem('username'); var username = lwx.getItem('username');
if(username) { if(username) {
@ -172,14 +180,19 @@
lwx.setItem('username',mobile); lwx.setItem('username',mobile);
pmsg.msg(data.msg); pmsg.msg(data.msg);
var url = $.trim($('#login_form').attr('data-url')); var url = $.trim($('#login_form').attr('data-url'));
setTimeout(function(){
if (url) { setTimeout(function(){
window.location.href = url; if (data.status == 2) {
} else { window.location.href = 'http://' + "{:C('APPLY_DOWN_DOMAIN')}" + "/index.php?s=/Home/Home/promitionofregestion/gid/" + gameId + "/pid/" + promoteId + "/status/" + "1" + ".html";
window.location.href = "{:U('index')}"; } else {
} if (url) {
},1500); window.location.href = url;
} else {
window.location.href = "{:U('index')}";
}
}
},1500);
}else{ }else{
pmsg.msg(data.msg); pmsg.msg(data.msg);
return false; return false;

@ -84,6 +84,8 @@
var mobile = $.trim($('#nickname').val()); var mobile = $.trim($('#nickname').val());
var code = $.trim($('#password').val()); var code = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val()); var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(mobile.length == 0 ){ if(mobile.length == 0 ){
pmsg.msg('昵称不能为空');event.preventDefault(); pmsg.msg('昵称不能为空');event.preventDefault();
return false; return false;
@ -105,7 +107,7 @@
$.ajax({ $.ajax({
type:'POST', type:'POST',
url:'{:U("User/step")}', url:'{:U("User/step")}',
data:{'nickname':mobile,'password':code,'sex':sex}, data:{'nickname':mobile,'password':code,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json", dataType:"Json",
success:function(data){ success:function(data){
console.log(data); console.log(data);

@ -90,6 +90,9 @@
var nickname = $.trim($('#nickname').val()) var nickname = $.trim($('#nickname').val())
var password = $.trim($('#password').val()); var password = $.trim($('#password').val());
var sex = $.trim($('input[name=sex]:checked').val()); var sex = $.trim($('input[name=sex]:checked').val());
var promoteId = parseInt("{:I('get.pid')}") ? parseInt("{:I('get.pid')}") : 0;
var gameId = parseInt("{:I('get.gid')}") ? parseInt("{:I('get.gid')}") : 0;
if(account.length == 0 ){ if(account.length == 0 ){
pmsg.msg('账号不能为空');event.preventDefault(); pmsg.msg('账号不能为空');event.preventDefault();
return false; return false;
@ -119,7 +122,7 @@
$.ajax({ $.ajax({
type:'POST', type:'POST',
url:'{:U("User/step1")}', url:'{:U("User/step1")}',
data:{'account':account,'nickname':nickname,'password':password,'sex':sex}, data:{'account':account,'nickname':nickname,'password':password,'sex':sex,'promote_id':promoteId,'game_id':gameId},
dataType:"Json", dataType:"Json",
success:function(data){ success:function(data){
pmsg.msg(data.msg); pmsg.msg(data.msg);

@ -60,4 +60,5 @@ INSERT INTO `tab_promote_quick_menu` VALUES ('16', '1', '10', '1569719877');
INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739'); INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739');
-- 2019-10-01 -- 2019-10-01
alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径'; alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径';
alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL default '' COMMENT '原包Plist路径';
Loading…
Cancel
Save