From bf7487727ee35a54655a1d4669c9cc57ea86ff43 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 15:23:40 +0800 Subject: [PATCH 1/6] 1 --- webapp/models/HashRateShopBuyRecord.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/models/HashRateShopBuyRecord.php b/webapp/models/HashRateShopBuyRecord.php index 8acd33c0..072d8521 100644 --- a/webapp/models/HashRateShopBuyRecord.php +++ b/webapp/models/HashRateShopBuyRecord.php @@ -75,17 +75,17 @@ class HashRateShopBuyRecord extends BaseModel 'this_day_buy_times' => function () use($goodsNum) { $nowDaySeconds = myself()->_getNowDaySeconds(); $cond = " last_buy_time>=${nowDaySeconds} AND last_buy_time<=${nowDaySeconds} + 3600 * 24 "; - return "CASE WHEN (${cond}) THEN this_day_buy_times + ${goodsNum} ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_day_buy_times + ${goodsNum} ELSE ${goodsNum} END"; }, 'this_week_buy_times' => function () use($goodsNum) { $mondaySeconds = myself()->_getMondaySeconds(); $cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 "; - return "CASE WHEN (${cond}) THEN this_week_buy_times + ${goodsNum} ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_week_buy_times + ${goodsNum} ELSE ${goodsNum} END"; }, 'this_month_buy_times' => function () use($goodsNum) { $monthFirstDaySeconds = myself()->_getMonthFirstDaySeconds(); $cond = " last_buy_time>=${monthFirstDaySeconds} "; - return "CASE WHEN (${cond}) THEN this_month_buy_times + ${goodsNum} ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_month_buy_times + ${goodsNum} ELSE ${goodsNum} END"; }, 'total_buy_times' => function () use($goodsNum) { return "total_buy_times + ${goodsNum}"; From 51ab36b3d6a2cb1cc57a6af3f5f3dbda236b9e17 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 15:24:39 +0800 Subject: [PATCH 2/6] 1 --- webapp/models/ShopBuyRecord.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/models/ShopBuyRecord.php b/webapp/models/ShopBuyRecord.php index 9a64a820..bc717409 100644 --- a/webapp/models/ShopBuyRecord.php +++ b/webapp/models/ShopBuyRecord.php @@ -111,12 +111,12 @@ class ShopBuyRecord extends BaseModel 'this_day_buy_times' => function () { $nowDaySeconds = myself()->_getNowDaySeconds(); $cond = " last_buy_time>=${nowDaySeconds} AND last_buy_time<=${nowDaySeconds} + 3600 * 24 "; - return "CASE WHEN (${cond}) THEN this_day_buy_times + 1 ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_day_buy_times + 1 ELSE 1 END"; }, 'this_week_buy_times' => function () { $mondaySeconds = myself()->_getMondaySeconds(); $cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 "; - return "CASE WHEN (${cond}) THEN this_week_buy_times + 1 ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_week_buy_times + 1 ELSE 1 END"; }, 'total_buy_times' => function () { return 'total_buy_times + 1'; From f797287f55fb6b70e8582fa8fdf5bae07aedfcbb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 15:26:32 +0800 Subject: [PATCH 3/6] 1 --- webapp/models/ShopBuyRecord.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/webapp/models/ShopBuyRecord.php b/webapp/models/ShopBuyRecord.php index bc717409..93dbc348 100644 --- a/webapp/models/ShopBuyRecord.php +++ b/webapp/models/ShopBuyRecord.php @@ -32,11 +32,13 @@ class ShopBuyRecord extends BaseModel ); return array_map(function ($row) { $nowDaySeconds = myself()->_getNowDaySeconds(); - if (!($row['last_buy_time'] >= $nowDaySeconds && $row['last_buy_time'] <= $nowDaySeconds)) { + if (!($row['last_buy_time'] >= $nowDaySeconds && + $row['last_buy_time'] <= $nowDaySeconds + 3600 * 24)) { $row['this_day_buy_times'] = 0; } $mondaySeconds = myself()->_getMondaySeconds(); - if (!($row['last_buy_time'] >= $mondaySeconds && $row['last_buy_time'] <= $mondaySeconds)) { + if (!($row['last_buy_time'] >= $mondaySeconds && + $row['last_buy_time'] <= $mondaySeconds + 3600 * 24 * 7)) { $row['this_week_buy_times'] = 0; } return $row; @@ -71,12 +73,12 @@ class ShopBuyRecord extends BaseModel 'this_day_buy_times' => function () { $nowDaySeconds = myself()->_getNowDaySeconds(); $cond = " last_buy_time>=${nowDaySeconds} AND last_buy_time<=${nowDaySeconds} + 3600 * 24 "; - return "CASE WHEN (${cond}) THEN this_day_buy_times + 1 ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_day_buy_times + 1 ELSE 1 END"; }, 'this_week_buy_times' => function () { $mondaySeconds = myself()->_getMondaySeconds(); $cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 "; - return "CASE WHEN (${cond}) THEN this_week_buy_times + 1 ELSE 0 END"; + return "CASE WHEN (${cond}) THEN this_week_buy_times + 1 ELSE 1 END"; }, 'total_buy_times' => function () { return 'total_buy_times + 1'; From 244a13ee9ef340c7f9b1771b00adbe20f0b06d5e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 15:27:21 +0800 Subject: [PATCH 4/6] 1 --- webapp/services/ShopService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webapp/services/ShopService.php b/webapp/services/ShopService.php index f726ffda..f3889a6a 100644 --- a/webapp/services/ShopService.php +++ b/webapp/services/ShopService.php @@ -42,7 +42,6 @@ class ShopService { 'bought_times' => 0, 'free_num' => 0, ); - array_push($goodsList, $goodsDto); switch ($goodsMeta['limit_type']) { case mt\Shop::DAILY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']); @@ -63,7 +62,7 @@ class ShopService { } break; } - + array_push($goodsList, $goodsDto); $itemMeta = mt\Item::get($goodsMeta['item_id']); if ($itemMeta) { /* From cd47fcb8baf18d39044003129983df9ec94ccd40 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 16:24:55 +0800 Subject: [PATCH 5/6] 1 --- webapp/mt/Shop.php | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/mt/Shop.php b/webapp/mt/Shop.php index 4ad35949..2c5becfe 100644 --- a/webapp/mt/Shop.php +++ b/webapp/mt/Shop.php @@ -43,6 +43,7 @@ class Shop { const WEEKLY_BUY_LIMIT = 2; const TOTAL_BUY_LIMIT = 3; + const DAILY_HERO_SHOP = 2; const OUTAPP_SHOP = 7; const INAPP_SHOP_DIAMOND = 9; From be1c2a72b3d42e0e1ae6b7e33bf99a606b3236dd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2024 17:14:47 +0800 Subject: [PATCH 6/6] 1 --- config/frienddb.mysql.cluster.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config/frienddb.mysql.cluster.php diff --git a/config/frienddb.mysql.cluster.php b/config/frienddb.mysql.cluster.php new file mode 100644 index 00000000..a52934e1 --- /dev/null +++ b/config/frienddb.mysql.cluster.php @@ -0,0 +1,11 @@ + 1, + 'host' => 'mysql-host', + 'port' => 3306, + 'user' => 'root', + 'passwd' => 'keji178', + 'dbname' => 'frienddb_dev_1' +); +