feat,wip : 거래장 페이지 작업 준비
- 필요에 따라 테이블 준비
This commit is contained in:
@@ -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 오류';
|
||||
}
|
||||
|
||||
+1
-1
@@ -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`;
|
||||
DROP TABLE IF EXISTS `ng_auction_bid`;
|
||||
@@ -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;
|
||||
@@ -0,0 +1,11 @@
|
||||
<template>
|
||||
<div>테스트</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
/*declare const staticValues: {
|
||||
serverID: string,
|
||||
serverNick: string,
|
||||
turnterm: number,
|
||||
};*/
|
||||
</script>
|
||||
<script lang="ts" setup></script>
|
||||
@@ -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')
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->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);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?= UniqueConst::$serverName ?>: <?= $boardName ?></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js', true) ?>
|
||||
<?= WebUtil::printStaticValues([
|
||||
'staticValues' => [
|
||||
'serverID' => UniqueConst::$serverID,
|
||||
'serverNick' => DB::prefix(),
|
||||
'turnterm' => $gameStor->turnterm,
|
||||
]
|
||||
]) ?>
|
||||
<?= WebUtil::printDist('vue', 'v_auction', true) ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user