From e0983bfb5670773c5212654f2ffcfe39e58593e3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 25 Jan 2022 19:42:22 +0800 Subject: [PATCH] 1 --- webapp/controller/MarketController.class.php | 7 +--- .../controller/NewMarketController.class.php | 7 +--- webapp/models/Goods.php | 38 ------------------- 3 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 webapp/models/Goods.php diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index c9bf9f5a..959f1a9b 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -6,10 +6,7 @@ require_once('mt/Item.php'); require_once('mt/WhiteList.php'); require_once('mt/Currency.php'); -require_once('models/Goods.php'); - use phpcommon\SqlHelper; -use models\Goods; class MarketController extends BaseController { @@ -37,8 +34,8 @@ class MarketController extends BaseController { 'batch_id' => $currBatchMeta['batch_id'], 'countdown' => max(0, $currBatchMeta['_start_time_utc'] - myself()->_getNowTime()), 'sold_num' => 0, - 'inventory_num' => 0, - 'hint' => $currBatchMeta['hint'], + 'inventory_num' => $currBatchMeta['number_of_props'], + 'hint' => str_replace("\n", '\n', $currBatchMeta['hint']), 'buyed' => rand() % 2 < 1 ? 0 : 1 ); diff --git a/webapp/controller/NewMarketController.class.php b/webapp/controller/NewMarketController.class.php index 6f0bd90c..e1866bdd 100644 --- a/webapp/controller/NewMarketController.class.php +++ b/webapp/controller/NewMarketController.class.php @@ -6,10 +6,7 @@ require_once('mt/Item.php'); require_once('mt/WhiteList.php'); require_once('mt/Currency.php'); -require_once('models/Goods.php'); - use phpcommon\SqlHelper; -use models\Goods; class NewMarketController extends BaseController { @@ -37,8 +34,8 @@ class NewMarketController extends BaseController { 'batch_id' => $currBatchMeta['batch_id'], 'countdown' => max(0, $currBatchMeta['_start_time_utc'] - myself()->_getNowTime()), 'sold_num' => 0, - 'inventory_num' => 0, - 'hint' => $currBatchMeta['hint'], + 'inventory_num' => $currBatchMeta['number_of_props'], + 'hint' => str_replace("\n", '\n', $currBatchMeta['hint']), 'buyed' => rand() % 2 < 1 ? 0 : 1 ); diff --git a/webapp/models/Goods.php b/webapp/models/Goods.php deleted file mode 100644 index e4f8d7ef..00000000 --- a/webapp/models/Goods.php +++ /dev/null @@ -1,38 +0,0 @@ -_getMarketMysql()->execQuery - ('SELECT goods_id, count(goods_idx) AS num FROM t_goods WHERE state=1 GROUP BY goods_id;', - array( - - )); - self::$buyedNumHash = array(); - foreach ($rows as $row) { - self::$buyedNumHash[$row['goods_id']] = $row['num']; - } - } - - private static $buyedNumHash; - -}