From bb04632a7f8801e6c5cc8a5e113654b7438a0f3d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Jun 2022 13:22:19 +0900 Subject: [PATCH] =?UTF-8?q?feat,wip=20:=20=EA=B1=B0=EB=9E=98=EC=9E=A5=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9E=91=EC=97=85=20=EC=A4=80?= =?UTF-8?q?=EB=B9=84=20-=20=ED=95=84=EC=9A=94=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=A4=80=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Auction.php | 10 +++++----- hwe/scss/auction.scss | 0 hwe/sql/reset.sql | 2 +- hwe/sql/schema.sql | 17 +++++++++++++++++ hwe/ts/PageAuction.vue | 11 +++++++++++ hwe/ts/v_auction.ts | 14 ++++++++++++++ hwe/v_auction.php | 39 +++++++++++++++++++++++++++++++++++++++ 7 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 hwe/scss/auction.scss create mode 100644 hwe/ts/PageAuction.vue create mode 100644 hwe/ts/v_auction.ts create mode 100644 hwe/v_auction.php diff --git a/hwe/sammo/Auction.php b/hwe/sammo/Auction.php index 62ce874e..c3ca625e 100644 --- a/hwe/sammo/Auction.php +++ b/hwe/sammo/Auction.php @@ -69,7 +69,7 @@ class Auction { $db = DB::db(); $rawHighestBid = $db->queryFirstRow( - 'SELECT * FROM ng_auction WHERE auction_id = %i ORDER BY `amount` DESC LIMIT 1', + 'SELECT * FROM ng_auction_bid WHERE auction_id = %i ORDER BY `amount` DESC LIMIT 1', $this->info->id ); if (!$rawHighestBid) { @@ -83,7 +83,7 @@ class Auction { $db = DB::db(); $rawMyPrevBid = $db->queryFirstRow( - 'SELECT * FROM ng_auction WHERE general_id = %i AND auction_id = %i ORDER BY `amount` DESC LIMIT 1', + 'SELECT * FROM ng_auction_bid WHERE general_id = %i AND auction_id = %i ORDER BY `amount` DESC LIMIT 1', $this->general->getID(), $this->info->id ); @@ -216,7 +216,7 @@ class Auction } $rawMyPrevBid = $db->queryFirstRow( - 'SELECT * FROM ng_auction WHERE general_id = %i AND auction_id = %i ORDER BY `amount` DESC LIMIT 1', + 'SELECT * FROM ng_auction_bid WHERE general_id = %i AND auction_id = %i ORDER BY `amount` DESC LIMIT 1', $general->getID(), $auctionInfo->id ); @@ -247,7 +247,7 @@ class Auction $tryExtendCloseDate, ) ); - $db->insert('ng_auction', $newBid->toArray()); + $db->insert('ng_auction_bid', $newBid->toArray()); if ($db->affectedRows() == 0) { return '입찰에 실패했습니다: DB 오류'; } @@ -339,7 +339,7 @@ class Auction ) ); - $db->insert('ng_auction', $newBid->toArray()); + $db->insert('ng_auction_bid', $newBid->toArray()); if ($db->affectedRows() == 0) { return '입찰에 실패했습니다: DB 오류'; } diff --git a/hwe/scss/auction.scss b/hwe/scss/auction.scss new file mode 100644 index 00000000..e69de29b diff --git a/hwe/sql/reset.sql b/hwe/sql/reset.sql index 4fdbf35b..c6464e56 100644 --- a/hwe/sql/reset.sql +++ b/hwe/sql/reset.sql @@ -68,4 +68,4 @@ DROP TABLE IF EXISTS ng_betting; DROP TABLE IF EXISTS vote; DROP TABLE IF EXISTS vote_comment; -DROP TABLE IF EXISTS `ng_auction`; \ No newline at end of file +DROP TABLE IF EXISTS `ng_auction_bid`; \ No newline at end of file diff --git a/hwe/sql/schema.sql b/hwe/sql/schema.sql index 1bba1110..00a1897c 100644 --- a/hwe/sql/schema.sql +++ b/hwe/sql/schema.sql @@ -706,4 +706,21 @@ CREATE TABLE `ng_auction` ( CONSTRAINT `aux` CHECK (json_valid(`aux`)) ) COLLATE='utf8mb4_general_ci' +ENGINE = Aria; + +CREATE TABLE `ng_auction_bid` ( + `no` INT(11) NOT NULL AUTO_INCREMENT, + `auction_id` INT(11) NOT NULL, + `owner` INT(11) NULL DEFAULT NULL, + `general_id` INT(11) NOT NULL, + `amount` INT(11) NOT NULL, + `date` DATETIME NOT NULL, + `aux` LONGTEXT NOT NULL COLLATE 'utf8mb4_bin', + PRIMARY KEY (`no`), + UNIQUE INDEX `by_general` (`general_id`, `auction_id`, `amount`), + UNIQUE INDEX `by_owner` (`owner`, `auction_id`, `amount`), + INDEX `by_amount` (`auction_id`, `amount`, `date`), + CONSTRAINT `aux` CHECK (json_valid(`aux`)) +) +COLLATE='utf8mb4_general_ci' ENGINE = Aria; \ No newline at end of file diff --git a/hwe/ts/PageAuction.vue b/hwe/ts/PageAuction.vue new file mode 100644 index 00000000..1f53efe3 --- /dev/null +++ b/hwe/ts/PageAuction.vue @@ -0,0 +1,11 @@ + + + diff --git a/hwe/ts/v_auction.ts b/hwe/ts/v_auction.ts new file mode 100644 index 00000000..4bef455a --- /dev/null +++ b/hwe/ts/v_auction.ts @@ -0,0 +1,14 @@ +import "@scss/auction.scss"; +import { createApp } from 'vue' +import PageAuction from '@/PageAuction.vue'; +import BootstrapVue3 from 'bootstrap-vue-3' +import { auto500px } from "./util/auto500px"; +import { insertCustomCSS } from "./util/customCSS"; +import { htmlReady } from "./util/htmlReady"; + +auto500px(); + +htmlReady(() => { + insertCustomCSS(); + }); +createApp(PageAuction).use(BootstrapVue3).mount('#app') \ No newline at end of file diff --git a/hwe/v_auction.php b/hwe/v_auction.php new file mode 100644 index 00000000..f9c26bae --- /dev/null +++ b/hwe/v_auction.php @@ -0,0 +1,39 @@ +setReadOnly(); +$userID = Session::getUserID(); + +$db = DB::db(); +$gameStor = KVStorage::getStorage($db, 'game_env'); + +$me = $db->queryFirstRow('SELECT no, nation, officer_level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID); + +?> + + + + + <?= UniqueConst::$serverName ?>: <?= $boardName ?> + + + + + [ + 'serverID' => UniqueConst::$serverID, + 'serverNick' => DB::prefix(), + 'turnterm' => $gameStor->turnterm, + ] + ]) ?> + + + +
+ + + \ No newline at end of file