예약 테이블 점검. 스키마 수정

This commit is contained in:
2018-06-29 01:50:28 +09:00
parent 07ba7933fb
commit 10e825dc9f
4 changed files with 20 additions and 7 deletions
+1 -6
View File
@@ -53,12 +53,7 @@ $conlimit = $gameStor->conlimit;
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
$style = "style=;";
if($general['block'] > 0) { $style .= "background-color:red;"; }
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
+9
View File
@@ -6,6 +6,15 @@ include "func.php";
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
Json::die([
'result'=>true,
'affected'=>0,
'status'=>'no_reserved_table'
]);
}
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
if(!$reserved){
+9
View File
@@ -41,5 +41,14 @@ DROP TABLE IF EXISTS world_history;
DROP TABLE IF EXISTS general_public_record;
DROP TABLE IF EXISTS reserved_open;
CREATE TABLE `reserved_open` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`options` TEXT NULL DEFAULT NULL,
`date` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `date` (`date`)
)
DEFAULT CHARSET=utf8mb4
ENGINE=MyISAM;
DROP TABLE IF EXISTS select_npc_token;
+1 -1
View File
@@ -618,7 +618,7 @@ ENGINE=InnoDB
######
#
CREATE TABLE `reserved_open` (
CREATE TABLE IF NOT EXISTS `reserved_open` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`options` TEXT NULL DEFAULT NULL,
`date` DATETIME NULL DEFAULT NULL,