修改分包

master
ELF 5 years ago
parent 09672d13b4
commit 679acf6cf1

@ -316,7 +316,7 @@ class AutoPackController extends Think
$applyIds = array_column($applys, 'id'); $applyIds = array_column($applys, 'id');
$gameIds = array_unique(array_column($applys, 'game_id')); $gameIds = array_unique(array_column($applys, 'game_id'));
$games = M('game', 'tab_')->field(['id', 'game_appid'])->where(['id' => ['in', $gameIds]])->select(); $games = M('game', 'tab_')->field(['id', 'game_appid', 'game_name', 'icon', 'sdk_version'])->where(['id' => ['in', $gameIds]])->select();
$games = index_by_column('id', $games); $games = index_by_column('id', $games);
$launchCountList = $launchModel->field(['apply_id', 'count(*) count'])->where(['apply_id' => ['in', $applyIds]])->group('apply_id')->select(); $launchCountList = $launchModel->field(['apply_id', 'count(*) count'])->where(['apply_id' => ['in', $applyIds]])->group('apply_id')->select();

@ -165,12 +165,12 @@ class GameSourceService {
$orgPlistUrl = ''; $orgPlistUrl = '';
if ($game['sdk_version'] == 2) { if ($game['sdk_version'] == 2) {
$params = [ $params = [
'domain' => '',
'packageName' => $gameSource['bao_name'], 'packageName' => $gameSource['bao_name'],
'gameId' => $game['id'], 'gameId' => $game['id'],
'gameName' => $game['game_name'],
'promoteId' => 0, 'promoteId' => 0,
'packageUrl' => $fileUrl, 'packageUrl' => $fileUrl,
'gameIcon' => '', 'gameIcon' => get_cover($game['icon'], 'path'),
'type' => 'pack' 'type' => 'pack'
]; ];
$result = $this->createPlist($params); $result = $this->createPlist($params);
@ -258,12 +258,12 @@ class GameSourceService {
$plistUrl = ''; $plistUrl = '';
if ($apply['sdk_version'] == 2) { if ($apply['sdk_version'] == 2) {
$params = [ $params = [
'domain' => '',
'packageName' => $gameSource['bao_name'], 'packageName' => $gameSource['bao_name'],
'gameId' => $game['id'], 'gameId' => $game['id'],
'gameName' => $game['game_name'],
'promoteId' => $apply['promote_id'], 'promoteId' => $apply['promote_id'],
'packageUrl' => $packageUrl, 'packageUrl' => $packageUrl,
'gameIcon' => '', 'gameIcon' => get_cover($game['icon'], 'path'),
'type' => 'pack' 'type' => 'pack'
]; ];
$result = $this->createPlist($params); $result = $this->createPlist($params);
@ -311,8 +311,8 @@ class GameSourceService {
//生成游戏渠道plist文件 //生成游戏渠道plist文件
public function createPlist($params) public function createPlist($params)
{ {
$domain = $params['domain'] ?? '';
$packageName = $params['packageName'] ?? ''; $packageName = $params['packageName'] ?? '';
$gameName = $params['gameName'] ?? '';
$gameId = $params['gameId'] ?? 0; $gameId = $params['gameId'] ?? 0;
$promoteId = $params['promoteId'] ?? 0; $promoteId = $params['promoteId'] ?? 0;
$packageUrl = $params['packageUrl'] ?? ''; $packageUrl = $params['packageUrl'] ?? '';
@ -344,14 +344,14 @@ class GameSourceService {
if (preg_match("/http/", $packageUrl)) { if (preg_match("/http/", $packageUrl)) {
$element->nodeValue = $packageUrl; $element->nodeValue = $packageUrl;
} else { } else {
$element->nodeValue = "https://" . $domain . ltrim($packageUrl, '.'); $element->nodeValue = C('DOMAIN_DOWNLOAD') . ltrim($packageUrl, '.');
} }
break; break;
case 'icon': case 'icon':
if (preg_match("/http/", $gameIcon)) { if (preg_match("/http/", $gameIcon)) {
$element->nodeValue = $gameIcon; $element->nodeValue = $gameIcon;
} else { } else {
$element->nodeValue = "https://" . $domain . $gameIcon; $element->nodeValue = C('DOMAIN_OFFICIAL_PC') . ltrim($gameIcon, '.');
} }
break; break;
case 'com.dell': case 'com.dell':
@ -361,7 +361,7 @@ class GameSourceService {
$element->nodeValue = false; $element->nodeValue = false;
break; break;
case 'mchdemo': case 'mchdemo':
$element->nodeValue = false; $element->nodeValue = $gameName;
break; break;
} }
} }

@ -67,7 +67,7 @@ class DownloadController extends Controller {
} else if (Request::isIOS()) { } else if (Request::isIOS()) {
$plistUrl = substr($packageUrl, 1, strlen($packageUrl)); $plistUrl = substr($packageUrl, 1, strlen($packageUrl));
header("HTTP/1.1 303 See Other"); header("HTTP/1.1 303 See Other");
header("Location: "."itms-services://?action=download-manifest&url=" . "https://" . Request::getHost() . "/" . $plistUrl); header("Location: "."itms-services://?action=download-manifest&url=" . Request::getHost() . "/" . $plistUrl);
} else { } else {
$this->gotoPkgUrl($packageUrl); $this->gotoPkgUrl($packageUrl);
} }

@ -1 +1 @@
sh -c "cd /var/www/platform/;php cli.php AutoPack/package;" sh -c "source /etc/profile;cd /var/www/platform/;php cli.php AutoPack/package;"
Loading…
Cancel
Save