Merge branch 'feature/upgrade_pack' into master_out

master
ELF 4 years ago
commit fe5a24f530

@ -51,18 +51,7 @@ class SourceEvent extends Controller
$data['bao_name'] = $packageName; $data['bao_name'] = $packageName;
$game = M('game', 'tab_')->where(['id' => $data['game_id']])->find(); $game = M('game', 'tab_')->where(['id' => $data['game_id']])->find();
$gameSourceService = new GameSourceService(); $gameSourceService = new GameSourceService();
$result = $gameSourceService->sourcePack($data, $game);
$gameSourceData = array_merge(
$data,
[
'plist_url' => '',
'org_plist_url' => '',
'file_url' => '',
'original_url' => '',
]
);
$result = $gameSourceService->sourcePack($gameSourceData, $game);
if (!$result['status']) { if (!$result['status']) {
$this->error('添加失败' , U('GameSource/lists', ['type' => $data['type']])); $this->error('添加失败' , U('GameSource/lists', ['type' => $data['type']]));
} }
@ -127,17 +116,7 @@ class SourceEvent extends Controller
$game = M('game', 'tab_')->where(['id' => $data['game_id']])->find(); $game = M('game', 'tab_')->where(['id' => $data['game_id']])->find();
$gameSourceService = new GameSourceService(); $gameSourceService = new GameSourceService();
$result = $gameSourceService->sourcePack($data, $game, $game_source);
$gameSourceData = array_merge(
$data,
[
'plist_url' => $game_source['plist_url'],
'org_plist_url' => $game_source['org_plist_url'],
'file_url' => $game_source['file_url'],
'original_url' => $game_source['original_url'],
]
);
$result = $gameSourceService->sourcePack($gameSourceData, $game);
if (!$result['status']) { if (!$result['status']) {
if ($from == "dev") { if ($from == "dev") {
$this->error('修改失败', U('Developers/source')); $this->error('修改失败', U('Developers/source'));

@ -139,7 +139,7 @@ class GameSourceService {
/** /**
* 原包打包 * 原包打包
*/ */
public function sourcePack($gameSource, $game) public function sourcePack($gameSource, $game, $olderSource = null)
{ {
$relativeUrl = $gameSource['file_url']; $relativeUrl = $gameSource['file_url'];
$localPath = ROOTTT . ltrim($relativeUrl, './'); $localPath = ROOTTT . ltrim($relativeUrl, './');
@ -160,10 +160,12 @@ class GameSourceService {
]; ];
} }
$this->removeOlderFile($gameSource['plist_url']); if ($olderSource) {
$this->removeOlderFile($gameSource['org_plist_url']); $this->removeOlderFile($olderSource['plist_url']);
$this->removeOlderFile($gameSource['file_url']); $this->removeOlderFile($olderSource['org_plist_url']);
$this->removeOlderFile($gameSource['original_url']); $this->removeOlderFile($olderSource['file_url']);
$this->removeOlderFile($olderSource['original_url']);
}
$distFilePath = 'SourcePack/' . $gameSource['file_name']; $distFilePath = 'SourcePack/' . $gameSource['file_name'];
$result = $this->uploadPackage($localPath, $distFilePath); $result = $this->uploadPackage($localPath, $distFilePath);
@ -319,8 +321,6 @@ class GameSourceService {
} }
$debugTime5 = microtime(true); $debugTime5 = microtime(true);
$plistInfo = ['game_id' => $apply['game_id'], 'promote_id' => $apply['promote_id']];
$plistUrl = ''; $plistUrl = '';
if ($apply['sdk_version'] == 2) { if ($apply['sdk_version'] == 2) {
$params = [ $params = [

Loading…
Cancel
Save