"; $channel = $_SESSION['spid']; $BranchNum = intval($_POST["BranchNum"]); $VersionState = intval($_POST["VersionState"]); $find = array( "Channel" => $channel, "BranchNum" => $BranchNum, "VersionState" => $VersionState, ); if ($opType == "del") { if (!DBOper\Remove("GameVersionState", $find)) { $alertMsg = "删除失败!"; \Logging\LogError($alertMsg . print_r($find, true)); return false; } $alertMsg = "删除成功!"; \Logging\LogInfo($alertMsg . print_r($find, true)); return true; } $StateName = $_POST["StateName"]; $JsonBranch = intval($_POST["JsonBranch"]); $NoticeUrl = $_POST["NoticeUrl"]; $ResourceUrl = $_POST["ResourceUrl"]; $ResourceAwardInfo = $_POST["ResourceAwardInfo"]; $IsDefault = intval($_POST["IsDefault"]); $editArray = array( "Channel" => $channel, "BranchNum" => $BranchNum, "VersionState" => $VersionState, "StateName" => $StateName, "JsonBranch" => $JsonBranch, "NoticeUrl" => $NoticeUrl, "ResourceUrl" => $ResourceUrl, "ResourceAwardInfo" => $ResourceAwardInfo, ); // 添加 if ($opType == "add") { DBOper\FindOne("GameVersionState", $find, $ret); if (count($ret) > 0) { $alertMsg = "该版本状态已存在,不能重复添加!"; \Logging\LogInfo($alertMsg . print_r($editArray, true)); return false; } if (!DBOper\Insert("GameVersionState", $editArray, $find)) { $alertMsg = "添加版本状态失败!"; \Logging\LogError($alertMsg . print_r($editArray, true)); return false; } $alertMsg = "添加版本状态成功!"; \Logging\LogInfo($alertMsg . print_r($editArray, true)); } // 更新 elseif ($opType == "upd") { $find["VersionState"] = intval($_POST["SrcVersionState"]); if (!DBOper\Update("GameVersionState", $find, $editArray, true)) { $alertMsg = "更新版本状态失败!"; \Logging\LogError($alertMsg . print_r($editArray, true)); return false; } $alertMsg = "更新版本状态成功!"; \Logging\LogInfo($alertMsg . print_r($editArray, true)); } return true; } $alertMsg = ""; $Permission = \User\Permission::P_OPSVersionState; $channel = $_SESSION['spid']; $user = new \User\User($_SESSION['UserAccount']); if (!$user->HavePermission($Permission)) { exit; } // 打包分支 $BranchNum = 0; $branchNameInfo = array(); DBOper\Find( "GamePackBranch", array("Channel" => $channel), $branchArray, array("BranchNum" => 1, "BranchName" => 1) ); foreach ($branchArray as $branchInfo) { $branchNameInfo[$branchInfo["BranchNum"]] = $branchInfo["BranchName"]; if ($BranchNum == 0) { $BranchNum = $branchInfo["BranchNum"]; } } if (array_key_exists("BranchNum", $_POST)) { $BranchNum = intval($_POST["BranchNum"]); VersionStateEdit($_POST["opType"]); } // 版本状态 DBOper\Find( "GameVersionState", array("Channel" => $channel, "BranchNum" => $BranchNum), $versionStateArray ); //显示表格字段配置 key-参数名,value-说明 $tableArray = array( "VersionState" => array("状态", "5%", "center"), "StateName" => array("状态名", "5%", "center"), "JsonBranch" => array("选服Json分支文件", "13%", "center"), "ResourceAwardInfo" => array("资源下载奖励信息", "9%", "center"), "ResourceUrl" => array("资源地址", "28%", "center"), "NoticeUrl" => array("公告地址", "28%", "center"), "" => array("操作", "", "center"), ); if ($alertMsg) { echo ""; } ?>
版本状态管理