|
|
@ -1140,43 +1140,53 @@ class PromoteController extends ThinkController
|
|
|
|
|
|
|
|
|
|
|
|
public function linkInfo() {
|
|
|
|
public function linkInfo() {
|
|
|
|
$link = $_REQUEST['link'];
|
|
|
|
$link = $_REQUEST['link'];
|
|
|
|
$strCode = "code/";
|
|
|
|
|
|
|
|
$link_type = $_REQUEST['link_type'];
|
|
|
|
|
|
|
|
$linkArr = strstr ( $link , $strCode );
|
|
|
|
|
|
|
|
$length = strlen($strCode);
|
|
|
|
|
|
|
|
$code = substr($linkArr, $length);
|
|
|
|
|
|
|
|
//$this->display();
|
|
|
|
|
|
|
|
$applyServe = new ApplyService();
|
|
|
|
$applyServe = new ApplyService();
|
|
|
|
$codeRes = $applyServe->decodeApplyCode($code);
|
|
|
|
$identifier = $applyServe->getPageIdentifier($link);
|
|
|
|
$promote_id = $codeRes['promote_id'];
|
|
|
|
if (!$identifier) {
|
|
|
|
$game_id = $codeRes["game_id"];
|
|
|
|
$this->assign('error', '链接异常');
|
|
|
|
$promoteInfo = M('promote','tab_')->field('account')->where(['id'=>$promote_id])->find();
|
|
|
|
return $this->display();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$promoteId = 0;
|
|
|
|
|
|
|
|
$gameId = 0;
|
|
|
|
|
|
|
|
$createdAt = '无法获知';
|
|
|
|
|
|
|
|
$expiresIn = 0;
|
|
|
|
|
|
|
|
$realType = 0;
|
|
|
|
|
|
|
|
if (isset($identifier['code'])) {
|
|
|
|
|
|
|
|
$result = $applyServe->decodeApplyCode($identifier['code']);
|
|
|
|
|
|
|
|
if (!$result) {
|
|
|
|
|
|
|
|
$this->assign('error', '解码异常');
|
|
|
|
|
|
|
|
return $this->display();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$promoteId = $result['promote_id'];
|
|
|
|
|
|
|
|
$gameId = $result["game_id"];
|
|
|
|
|
|
|
|
$expiresIn = $result['expires_in'];
|
|
|
|
|
|
|
|
$createdAt = $result['created_at'];
|
|
|
|
|
|
|
|
$realType = $result['type'];
|
|
|
|
|
|
|
|
} else if(isset($identifier['promote_id']) && isset($identifier['game_id'])) {
|
|
|
|
|
|
|
|
$promoteId = $identifier['promote_id'];
|
|
|
|
|
|
|
|
$gameId = $identifier["game_id"];
|
|
|
|
|
|
|
|
$realType = $identifier['type'];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$promoteInfo = M('promote','tab_')->field('account')->where(['id'=>$promoteId])->find();
|
|
|
|
$params['account'] = $promoteInfo['account'];
|
|
|
|
$params['account'] = $promoteInfo['account'];
|
|
|
|
$game_id = $codeRes['game_id'];
|
|
|
|
$gameInfo = M('game','tab_')->field('game_name')->where(['id'=>$gameId])->find();
|
|
|
|
$gameInfo = M('game','tab_')->field('game_name')->where(['id'=>$game_id])->find();
|
|
|
|
|
|
|
|
$params['game_name'] = $gameInfo['game_name'];
|
|
|
|
$params['game_name'] = $gameInfo['game_name'];
|
|
|
|
if(!empty($codeRes)) {
|
|
|
|
|
|
|
|
$expires_in = $codeRes['expires_in'];
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
$expires_in = -100;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($expires_in == 0) {
|
|
|
|
if($expiresIn == 0) {
|
|
|
|
$params['expires_in'] = "永久性";
|
|
|
|
$params['expires_in'] = "永久性";
|
|
|
|
}else if($expires_in > 0) {
|
|
|
|
}else if($expiresIn > 0) {
|
|
|
|
$params['expires_in'] = $expires_in;
|
|
|
|
$params['expires_in'] = $expiresIn;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$params['created_at'] = $codeRes['created_at'];
|
|
|
|
$params['created_at'] = $createdAt;
|
|
|
|
if($codeRes['type'] == 1) {
|
|
|
|
if($realType == 1) {
|
|
|
|
$params['type'] = '复制下载链接';
|
|
|
|
$params['type'] = '下载链接';
|
|
|
|
}else if($codeRes['type'] == 2) {
|
|
|
|
} else if($realType == 2) {
|
|
|
|
$params['type'] = '落地页链接';
|
|
|
|
$params['type'] = '落地页链接';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($codeRes['type'] == $link_type || $link_type == 0) {
|
|
|
|
$this->assign('params',$params);
|
|
|
|
$this->assign('params',$params);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->display();
|
|
|
|
$this->display();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|