diff --git a/Application/Admin/Controller/PlistController.class.php b/Application/Admin/Controller/PlistController.class.php index 6b8e0e8d2..ed5f94f07 100644 --- a/Application/Admin/Controller/PlistController.class.php +++ b/Application/Admin/Controller/PlistController.class.php @@ -54,6 +54,39 @@ class PlistController extends ThinkController { } + public function create_org_plist($game_id=0,$promote_id=0,$marking="",$url=""){ + $xml = new \DOMDocument(); + $xml->load('./Uploads/Plist/testdemo.Plist'); + $online = $xml->getElementsByTagName('dict');//查找节点 + $asd=$online->item(1)->getElementsByTagName('string');//第二个节点下所有string + foreach ($asd as $key=>$value) { + switch ($value->textContent) { + case 'ipa_url': + if(preg_match("/Uploads/", $url)){ + $value->nodeValue="https://".$_SERVER['HTTP_HOST'].ltrim($url,".");//"https://iosdemo.vlcms.com/app/MCHSecretary.ipa";//替换xml对应的值 + }else{ + $value->nodeValue=$url; + } + break; + case 'icon': + $value->nodeValue="https://".$_SERVER["HTTP_HOST"].get_cover(get_game_icon_id($game_id),'path');; + break; + case 'com.dell': + $value->nodeValue=$marking; + break; + case '1.0.0': + $value->nodeValue=game_version($game_id); + break; + case 'mchdemo': + $value->nodeValue=get_ios_game_name($game_id); + break; + + } + $xml->save("./Uploads/OrgSourcePlist/$game_id.Plist"); + } + return "./Uploads/OrgSourcePlist/$game_id.Plist"; + } + //生成App plist文件 public function create_plist_app($version="",$app_id=0,$marking="",$url="", $promote_id=0){ diff --git a/Application/Admin/Event/SourceEvent.class.php b/Application/Admin/Event/SourceEvent.class.php index 17f1a5115..1af21ac3f 100644 --- a/Application/Admin/Event/SourceEvent.class.php +++ b/Application/Admin/Event/SourceEvent.class.php @@ -41,6 +41,7 @@ class SourceEvent extends Controller $data['remark'] = json_encode(explode('@@@', $remark)); if ($data['file_type'] == 2) { $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; + $data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist"; $plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']); } $res = $model -> add($data); @@ -100,6 +101,7 @@ class SourceEvent extends Controller } if ($data['file_type'] == 2) { $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; + $data['org_plist_url'] = "./Uploads/OrgSourcePlist/" . $data['game_id'] . ".Plist"; $plist -> create_plist($data['game_id'], 0, $data['bao_name'], $data['file_url']); } $data['source_version'] = $game_source['source_version'] + 1; @@ -265,6 +267,7 @@ class SourceEvent extends Controller if ($file_type == 2) { $data['plist_url'] = "./Uploads/SourcePlist/" . $data['game_id'] . ".Plist"; $plist -> create_plist($game_id, 0, $baoName, $to); + $plist -> create_org_plist($game_id, 0, $baoName, $originalUrl); } } diff --git a/Data/update.sql b/Data/update.sql index a4d87ab43..3c812eda2 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -60,4 +60,5 @@ INSERT INTO `tab_promote_quick_menu` VALUES ('16', '1', '10', '1569719877'); INSERT INTO `tab_promote_quick_menu` VALUES ('18', '1', '1', '1569720739'); -- 2019-10-01 -alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径'; \ No newline at end of file +alter table tab_game_source add column `original_url` varchar(255) NOT NULL default '' COMMENT '原包路径'; +alter table tab_game_source add column `org_plist_url` varchar(255) NOT NULL default '' COMMENT '原包Plist路径'; \ No newline at end of file