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;
$game = M('game', 'tab_')->where(['id' => $data['game_id']])->find();
$gameSourceService = new GameSourceService();
$gameSourceData = array_merge(
$data,
[
'plist_url' => '',
'org_plist_url' => '',
'file_url' => '',
'original_url' => '',
]
);
$result = $gameSourceService->sourcePack($gameSourceData, $game);
$result = $gameSourceService->sourcePack($data, $game);
if (!$result['status']) {
$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();
$gameSourceService = new GameSourceService();
$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);
$result = $gameSourceService->sourcePack($data, $game, $game_source);
if (!$result['status']) {
if ($from == "dev") {
$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'];
$localPath = ROOTTT . ltrim($relativeUrl, './');
@ -160,10 +160,12 @@ class GameSourceService {
];
}
$this->removeOlderFile($gameSource['plist_url']);
$this->removeOlderFile($gameSource['org_plist_url']);
$this->removeOlderFile($gameSource['file_url']);
$this->removeOlderFile($gameSource['original_url']);
if ($olderSource) {
$this->removeOlderFile($olderSource['plist_url']);
$this->removeOlderFile($olderSource['org_plist_url']);
$this->removeOlderFile($olderSource['file_url']);
$this->removeOlderFile($olderSource['original_url']);
}
$distFilePath = 'SourcePack/' . $gameSource['file_name'];
$result = $this->uploadPackage($localPath, $distFilePath);
@ -319,8 +321,6 @@ class GameSourceService {
}
$debugTime5 = microtime(true);
$plistInfo = ['game_id' => $apply['game_id'], 'promote_id' => $apply['promote_id']];
$plistUrl = '';
if ($apply['sdk_version'] == 2) {
$params = [

Loading…
Cancel
Save