|
|
|
@ -1102,42 +1102,52 @@ class PromoteController extends ThinkController
|
|
|
|
|
|
|
|
|
|
public function linkInfo() {
|
|
|
|
|
$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();
|
|
|
|
|
$codeRes = $applyServe->decodeApplyCode($code);
|
|
|
|
|
$promote_id = $codeRes['promote_id'];
|
|
|
|
|
$game_id = $codeRes["game_id"];
|
|
|
|
|
$promoteInfo = M('promote','tab_')->field('account')->where(['id'=>$promote_id])->find();
|
|
|
|
|
$identifier = $applyServe->getPageIdentifier($link);
|
|
|
|
|
if (!$identifier) {
|
|
|
|
|
$this->assign('error', '链接异常');
|
|
|
|
|
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'];
|
|
|
|
|
$game_id = $codeRes['game_id'];
|
|
|
|
|
$gameInfo = M('game','tab_')->field('game_name')->where(['id'=>$game_id])->find();
|
|
|
|
|
$gameInfo = M('game','tab_')->field('game_name')->where(['id'=>$gameId])->find();
|
|
|
|
|
$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'] = "永久性";
|
|
|
|
|
}else if($expires_in > 0) {
|
|
|
|
|
$params['expires_in'] = $expires_in;
|
|
|
|
|
}else if($expiresIn > 0) {
|
|
|
|
|
$params['expires_in'] = $expiresIn;
|
|
|
|
|
}
|
|
|
|
|
$params['created_at'] = $codeRes['created_at'];
|
|
|
|
|
if($codeRes['type'] == 1) {
|
|
|
|
|
$params['type'] = '复制下载链接';
|
|
|
|
|
}else if($codeRes['type'] == 2) {
|
|
|
|
|
$params['created_at'] = $createdAt;
|
|
|
|
|
if($realType == 1) {
|
|
|
|
|
$params['type'] = '下载链接';
|
|
|
|
|
} else if($realType == 2) {
|
|
|
|
|
$params['type'] = '落地页链接';
|
|
|
|
|
}
|
|
|
|
|
if($codeRes['type'] == $link_type || $link_type == 0) {
|
|
|
|
|
$this->assign('params',$params);
|
|
|
|
|
}
|
|
|
|
|
$this->assign('params',$params);
|
|
|
|
|
$this->display();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|