From c0f19228d2c2640bc6972bf63048de07a8fd5aa4 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 21 Nov 2019 11:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Event/SourceEvent.class.php | 17 +++++++++++++++++ .../Base/Service/GameSourceService.class.php | 2 +- .../Home/Controller/PackageController.class.php | 2 +- .../Home/View/default/Home/landingPage.html | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Event/SourceEvent.class.php b/Application/Admin/Event/SourceEvent.class.php index 3264c60f0..b02414a9c 100644 --- a/Application/Admin/Event/SourceEvent.class.php +++ b/Application/Admin/Event/SourceEvent.class.php @@ -97,6 +97,23 @@ class SourceEvent extends Controller } $data['source_version'] = $game_source['source_version'] + 1; + $version = ''; + $packageName = ''; + if ($data['file_type'] == 1) { + $parser = new ApkParser(); + $parser->open($data['file_url']); + $version = $parser->getVersionName(); + $packageName = $parser->getPackage(); + } elseif($data['file_type'] == 2) { + $parser = new PlistParser(); + $parser->openFromIpa($data['file_url'], PlistParser::PREG_INFO_PLIST); + $result = $parser->getResult(); + $version = $result['CFBundleShortVersionString']; + $packageName = $result['CFBundleIdentifier']; + } + $data['version'] = $version; + $data['bao_name'] = $packageName; + $game = M('game', 'tab_')->where(['id' => $data['game_id']])->find(); $gameSourceService = new GameSourceService(); $result = $gameSourceService->sourcePack($data, $game); diff --git a/Application/Base/Service/GameSourceService.class.php b/Application/Base/Service/GameSourceService.class.php index 3ba19c298..007c8793f 100644 --- a/Application/Base/Service/GameSourceService.class.php +++ b/Application/Base/Service/GameSourceService.class.php @@ -182,6 +182,7 @@ class GameSourceService { 'gameIcon' => get_cover($game['icon'], 'path'), 'type' => 'pack' ]; + $result = $this->createPlist($params); if ($result['status']) { $plistUrl = $result['data']['path']; @@ -412,7 +413,6 @@ class GameSourceService { } elseif ($type == 'org') { $fileName = 'Uploads/OrgSourcePlist/'. $gameId . '.Plist'; } - $xml->save('./' . $fileName); return [ 'status' => true, diff --git a/Application/Home/Controller/PackageController.class.php b/Application/Home/Controller/PackageController.class.php index bd1eeb7c0..ebd8279c8 100644 --- a/Application/Home/Controller/PackageController.class.php +++ b/Application/Home/Controller/PackageController.class.php @@ -30,7 +30,7 @@ class PackageController extends Controller $code = I('code', ''); $gameId = I('game_id', 0); $promoteId = I('promote_id', 0); - +// var_dump($gameId, $promoteId);die(); if ($code == '' && ($gameId == 0 || $promoteId == 0)) { $this->redirect("package/downloadError", ['message' => '访问错误']); } diff --git a/Application/Home/View/default/Home/landingPage.html b/Application/Home/View/default/Home/landingPage.html index b4ed5dc6b..e65a21fda 100644 --- a/Application/Home/View/default/Home/landingPage.html +++ b/Application/Home/View/default/Home/landingPage.html @@ -50,7 +50,7 @@ return } if ($('input[name=isIOS13]').val() == 1) { - if (parseInt("{:I('get.status')}") > 0) { + if (parseInt("{:I('get.status', 0)}") > 0) { location.href = "{:U('iosDown',array('gid'=>$apply['game_id'],'pid'=>$apply['promote_id'],'status'=>1))}" return } else {