From bda153a656b84d99d400f0fad0cb77a7ad4307d2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:00:30 +0800 Subject: [PATCH 01/16] 1 --- .../controller/BigwheelController.class.php | 89 ++++++++++++++++++- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 37a06085..a84263ba 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -74,14 +74,97 @@ class BigwheelController extends BaseAuthedController { myself()->_rspErr(3, 'config error'); return; } - } else if ($drawType == 1 || $drawType == 2) { + } else { $costItemNum = $priceInfo['price_single'] * $priceInfo['discount_single']; if (empty($costItemNum)) { myself()->_rspErr(3, 'config error'); return; } - } else { - myself()->_rspErr(2, 'type param error'); + } + $item1Hash = array(); + $item1Arr = array(); + $item2Hash = array(); + $item2Arr = array(); + mt\Bigwheel::traverseMeta( + function ($meta) use(&$data, &$item1Hash, &$item2Hash, &$item1Arr, &$item2Arr) { + $gridRef = null; + $this->getGridRefByGridId($data, $meta['id'], $girdRef); + switch ($meta['Wheel_type']) { + case 1:{ + $item1Hash[$meta['id']] = $meta; + array_push($item1Arr, array( + 'weight' => 0, + 'meta' => $meta + )); + } + break; + case 2:{ + $item2Hash[$meta['id']] = $meta; + array_push($item2Arr, array( + 'weight' => 0, + 'meta' => $meta + )); + } + break; + } + return true; + }); + if (count($item1Hash) != count($item2Hash) || + count($item1Arr) != count($item2Arr) || + count($item1Arr) != count($item1Hash) || + count($item1Hash) < 1) { + myself()->_rspErr(1, 'The maximum number of lucky draws has been reached'); + return; + } + $randSpace1 = 0; + foreach ($item1Arr as &$item) { + $randSpace1 += $item['meta']['reWeight']; + $item['weight'] = $randSpace1; + } + $randSpace2 = 0; + foreach ($item2Arr as &$item) { + $randSpace2 += $item['meta']['reWeight']; + $item['weight'] = $randSpace2; + } + error_log(json_encode(array( + 'randSpace1' => $randSpace1, + 'randSpace2' => $randSpace2, + 'item1Arr' => $item1Arr, + 'item2Arr' => $item2Arr, + ))); + if ($randSpace1 <= 0 || + $randSpace2 <= 0) { + myself()->_rspErr(1, 'server internal error'); + return; + } + $item1 = null; + { + $rnd = rand(0, $randSpace1 - 1); + foreach ($item1Arr as $item) { + if ($item['weight'] <= $rnd) { + $item1 = $item; + break; + } + } + } + $item2 = null; + { + $rnd = rand(0, $randSpace2 - 2); + foreach ($item2Arr as $item) { + if ($item['weight'] <= $rnd) { + $item2 = $item; + break; + } + } + } + if (empty($item1) || empty($item2)) { + myself()->_rspErr(1, 'server internal error'); + return; + } + $lootMeta1 = myself()->_callMtStatic('LootConfig', 'find', $item1['meta']['content_loot']); + $lootMeta2 = myself()->_callMtStatic('LootConfig', 'find', $item2['meta']['content_loot']); + if (empty($lootMeta2) || empty($lootMeta2)) { + myself()->_rspErr(1, 'server internal error'); return; } } From 19637fd825e39e9b7204090aca5d635a0349a753 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:11:30 +0800 Subject: [PATCH 02/16] 1 --- .../controller/BigwheelController.class.php | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index a84263ba..10a6cf10 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -167,6 +167,32 @@ class BigwheelController extends BaseAuthedController { myself()->_rspErr(1, 'server internal error'); return; } + $drop1 = myself()->_callServiceStatic('LootService', 'dropOutItem', $item1['meta']['content_loot']); + $drop2 = myself()->_callServiceStatic('LootService', 'dropOutItem', $item2['meta']['content_loot']); + error_log(json_encode(array( + 'drop1' => $drop1, + 'drop2' => $drop2, + ))); + ++$data['drawed_times']; + $grid1 = array( + 'grid_id' => $item1['meta']['id'], + 'grid_state' => 2, + 'item_id' => $drop1[0]['item_id'], + 'item_num' => $drop1[0]['item_num'], + 'buy_price' => 0, + 'draw_times' => $data['drawed_times'], + ); + $grid2 = array( + 'grid_id' => $item2['meta']['id'], + 'grid_state' => 2, + 'item_id' => $drop2[0]['item_id'], + 'item_num' => $drop2[0]['item_num'], + 'buy_price' => 0, + 'draw_times' => $data['drawed_times'], + ); + array_push($data['grid_list'], $grid1); + array_push($data['grid_list'], $grid2); + myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); } public function buyS() @@ -183,9 +209,6 @@ class BigwheelController extends BaseAuthedController { private function getAndCreateData($key) { $data = myself()->_callModelStatic('MidData', 'getData', $key); - if (!empty($data)) { - $data = json_decode($data, true); - } if (empty($data)) { $data = array( 'drawed_times' => 0, @@ -236,7 +259,7 @@ class BigwheelController extends BaseAuthedController { private function getGridRefByGridId(&$data, $gridId, &$gridRefOut) { foreach ($data['grid_list'] as &$grid) { - if ($grid['grid_id'] == $girdId) { + if ($grid['grid_id'] == $gridId) { $gridRefOut = $grid; break; } From aaa0003b645a3a257e5025fc4eac09613344b6f2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:12:56 +0800 Subject: [PATCH 03/16] 1 --- webapp/controller/BigwheelController.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 10a6cf10..836ae737 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -193,6 +193,18 @@ class BigwheelController extends BaseAuthedController { array_push($data['grid_list'], $grid1); array_push($data['grid_list'], $grid2); myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); + { + $priceInfo = $this->getPriceInfo($data['drawed_times']); + if (empty($priceInfo)) { + myself()->_rspErr(500, 'server internal error'); + return; + } + $info = array(); + $this->fillInfo($info, $data, $priceInfo); + myself()->_rspData(array( + 'info' => $info + )); + } } public function buyS() From 5f0266a4347d9b3c7de7457a829d51df20b1ebb1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:16:01 +0800 Subject: [PATCH 04/16] 1 --- webapp/controller/BigwheelController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 836ae737..2bf6adce 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -176,7 +176,7 @@ class BigwheelController extends BaseAuthedController { ++$data['drawed_times']; $grid1 = array( 'grid_id' => $item1['meta']['id'], - 'grid_state' => 2, + 'grid_state' => 1, 'item_id' => $drop1[0]['item_id'], 'item_num' => $drop1[0]['item_num'], 'buy_price' => 0, @@ -184,7 +184,7 @@ class BigwheelController extends BaseAuthedController { ); $grid2 = array( 'grid_id' => $item2['meta']['id'], - 'grid_state' => 2, + 'grid_state' => 1, 'item_id' => $drop2[0]['item_id'], 'item_num' => $drop2[0]['item_num'], 'buy_price' => 0, @@ -296,7 +296,7 @@ class BigwheelController extends BaseAuthedController { if ($drawedTimes < 0) { return null; } - if ($drawedTimes > self::MAX_DRAW_TIMES) { + if ($drawedTimes >= self::MAX_DRAW_TIMES) { $drawedTimes = self::MAX_DRAW_TIMES - 1; } $priceInfo = array( From 55de57d626fa366480fb36271a40c4940d2c6ac4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:22:18 +0800 Subject: [PATCH 05/16] 1 --- webapp/controller/BigwheelController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 2bf6adce..366c6b76 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -250,7 +250,7 @@ class BigwheelController extends BaseAuthedController { 'buy_price' => 0, ); $gridRef = null; - $this->getGridRefByGridId($data, $meta['id'], $girdRef); + $this->getGridRefByGridId($data, $meta['id'], $gridRef); if (!empty($gridRef)) { $item = $gridRef; } From 2b266d045ad3fc98e2661f2973c98d3010ef4547 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:23:42 +0800 Subject: [PATCH 06/16] 1 --- webapp/models/MidData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/models/MidData.php b/webapp/models/MidData.php index f94aed26..3960c9b6 100644 --- a/webapp/models/MidData.php +++ b/webapp/models/MidData.php @@ -7,7 +7,7 @@ use phpcommon\SqlHelper; class MidData extends BaseModel { - const BIG_WHEEL_TYPE = 'offer.reward.missions'; + const BIG_WHEEL_TYPE = 'big_wheel'; public static function getData($type) { From 9d327bcaad5ef9e09efc3fcc708ca73b7e9f25de Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:29:28 +0800 Subject: [PATCH 07/16] 1 --- .../controller/BigwheelController.class.php | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 366c6b76..b0f24a10 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -88,24 +88,26 @@ class BigwheelController extends BaseAuthedController { mt\Bigwheel::traverseMeta( function ($meta) use(&$data, &$item1Hash, &$item2Hash, &$item1Arr, &$item2Arr) { $gridRef = null; - $this->getGridRefByGridId($data, $meta['id'], $girdRef); - switch ($meta['Wheel_type']) { - case 1:{ - $item1Hash[$meta['id']] = $meta; - array_push($item1Arr, array( - 'weight' => 0, - 'meta' => $meta - )); - } - break; - case 2:{ - $item2Hash[$meta['id']] = $meta; - array_push($item2Arr, array( - 'weight' => 0, - 'meta' => $meta - )); - } - break; + $this->getGridRefByGridId($data, $meta['id'], $gridRef); + if (empty($gridRef)) { + switch ($meta['Wheel_type']) { + case 1:{ + $item1Hash[$meta['id']] = $meta; + array_push($item1Arr, array( + 'weight' => 0, + 'meta' => $meta + )); + } + break; + case 2:{ + $item2Hash[$meta['id']] = $meta; + array_push($item2Arr, array( + 'weight' => 0, + 'meta' => $meta + )); + } + break; + } } return true; }); @@ -141,7 +143,7 @@ class BigwheelController extends BaseAuthedController { { $rnd = rand(0, $randSpace1 - 1); foreach ($item1Arr as $item) { - if ($item['weight'] <= $rnd) { + if ($rnd <= $item['weight']) { $item1 = $item; break; } @@ -151,7 +153,7 @@ class BigwheelController extends BaseAuthedController { { $rnd = rand(0, $randSpace2 - 2); foreach ($item2Arr as $item) { - if ($item['weight'] <= $rnd) { + if ($rnd <= $item['weight']) { $item2 = $item; break; } From d33d789baf0a4a7c38b01cb6386d54406a7dd935 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:33:12 +0800 Subject: [PATCH 08/16] 1 --- webapp/controller/BigwheelController.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index b0f24a10..e1f31b27 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -192,6 +192,12 @@ class BigwheelController extends BaseAuthedController { 'buy_price' => 0, 'draw_times' => $data['drawed_times'], ); + if ($drawType == 1) { + $grid2['grid_state'] = 2; + } + if ($drawType == 2) { + $grid1['grid_state'] = 2; + } array_push($data['grid_list'], $grid1); array_push($data['grid_list'], $grid2); myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); From 681cb9e719e3e6d056baa513ac0433ea9a477762 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:52:54 +0800 Subject: [PATCH 09/16] 1 --- .../controller/BigwheelController.class.php | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index e1f31b27..c36ca0bf 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -29,6 +29,13 @@ class BigwheelController extends BaseAuthedController { const MAX_DRAW_TIMES = 9; + public function _handlePre() + { + parent::_handlePre(); + $this->propertyChgService = new services\PropertyChgService(); + $this->awardService = new services\AwardService(); + } + public function info() { $key = $this->getMidDataKey(); @@ -192,14 +199,36 @@ class BigwheelController extends BaseAuthedController { 'buy_price' => 0, 'draw_times' => $data['drawed_times'], ); + $items = array(); if ($drawType == 1) { $grid2['grid_state'] = 2; - } - if ($drawType == 2) { + foreach ($drop1 as $itemTemp){ + array_push($items, $itemTemp); + } + } else if ($drawType == 2) { $grid1['grid_state'] = 2; + foreach ($drop2 as $itemTemp){ + array_push($items, $itemTemp); + } + } else { + foreach ($drop1 as $itemTemp){ + array_push($items, $itemTemp); + } + foreach ($drop2 as $itemTemp){ + array_push($items, $itemTemp); + } + } + $hashItems = array(); + foreach ($items as $item){ + if (isset($hashItems[$item['item_id']])){ + $hashItems[$item['item_id']]['item_num'] += $item['item_num']; + }else{ + $hashItems[$item['item_id']] = $item; + } } array_push($data['grid_list'], $grid1); array_push($data['grid_list'], $grid2); + myself()->_addItems($hashItems, $this->awardService, $this->propertyChgService); myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); { $priceInfo = $this->getPriceInfo($data['drawed_times']); @@ -210,6 +239,8 @@ class BigwheelController extends BaseAuthedController { $info = array(); $this->fillInfo($info, $data, $priceInfo); myself()->_rspData(array( + 'award' => $this->awardService->toDto(), + 'property_chg' => $this->propertyChgService->toDto(), 'info' => $info )); } From f8008af8cc6b6ba03ba59011c6f56b07b0c488c0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 17:58:38 +0800 Subject: [PATCH 10/16] 1 --- webapp/controller/BigwheelController.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index c36ca0bf..a687e40f 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -135,9 +135,13 @@ class BigwheelController extends BaseAuthedController { $randSpace2 += $item['meta']['reWeight']; $item['weight'] = $randSpace2; } + $rnd1 = rand(0, $randSpace1 - 1); + $rnd2 = rand(0, $randSpace2 - 1); error_log(json_encode(array( 'randSpace1' => $randSpace1, 'randSpace2' => $randSpace2, + 'rnd1' => $rnd1, + 'rnd2' => $rnd2, 'item1Arr' => $item1Arr, 'item2Arr' => $item2Arr, ))); @@ -148,9 +152,8 @@ class BigwheelController extends BaseAuthedController { } $item1 = null; { - $rnd = rand(0, $randSpace1 - 1); foreach ($item1Arr as $item) { - if ($rnd <= $item['weight']) { + if ($rnd1 <= $item['weight']) { $item1 = $item; break; } @@ -158,9 +161,8 @@ class BigwheelController extends BaseAuthedController { } $item2 = null; { - $rnd = rand(0, $randSpace2 - 2); foreach ($item2Arr as $item) { - if ($rnd <= $item['weight']) { + if ($rnd2 <= $item['weight']) { $item2 = $item; break; } From 203eafe9929b6840d6aae5009376f05243319af2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 18:23:14 +0800 Subject: [PATCH 11/16] 1 --- .../controller/BigwheelController.class.php | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index a687e40f..bcdbf32d 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -151,23 +151,38 @@ class BigwheelController extends BaseAuthedController { return; } $item1 = null; + error_log(json_encode(array( + 'item2arr' => $item2Arr + ))); { - foreach ($item1Arr as $item) { - if ($rnd1 <= $item['weight']) { - $item1 = $item; + foreach ($item1Arr as $itemTmp1) { + if ($rnd1 <= $itemTmp1['weight']) { + $item1 = $itemTmp1; break; } } } $item2 = null; { - foreach ($item2Arr as $item) { - if ($rnd2 <= $item['weight']) { - $item2 = $item; + error_log(json_encode(array( + 'item2arr' => $item2Arr + ))); + foreach ($item2Arr as $itemTmp2) { + error_log(json_encode(array( + 'rnd2' => $rnd2, + 'item' => $itemTmp2, + //'item2_weight' => $item['weight'], + ))); + if ($rnd2 <= $itemTmp2['weight']) { + $item2 = $itemTmp2; break; } } } + error_log(json_encode(array( + 'item1' => $item1, + 'item2' => $item2, + ))); if (empty($item1) || empty($item2)) { myself()->_rspErr(1, 'server internal error'); return; From 4a2983130d20abe7e9abc79e67002329803e0282 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 18:26:58 +0800 Subject: [PATCH 12/16] 1 --- webapp/controller/BigwheelController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index bcdbf32d..19c2f9d5 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -205,7 +205,7 @@ class BigwheelController extends BaseAuthedController { 'grid_state' => 1, 'item_id' => $drop1[0]['item_id'], 'item_num' => $drop1[0]['item_num'], - 'buy_price' => 0, + 'buy_price' => $priceInfo['price_buy'] * $priceInfo['discount_buy'], 'draw_times' => $data['drawed_times'], ); $grid2 = array( @@ -213,7 +213,7 @@ class BigwheelController extends BaseAuthedController { 'grid_state' => 1, 'item_id' => $drop2[0]['item_id'], 'item_num' => $drop2[0]['item_num'], - 'buy_price' => 0, + 'buy_price' => $priceInfo['price_buy'] * $priceInfo['discount_buy'], 'draw_times' => $data['drawed_times'], ); $items = array(); From e0cf6486ec15ce1efa099c1e2bb5ecfcd6fefddb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 18:42:38 +0800 Subject: [PATCH 13/16] 1 --- .../controller/BigwheelController.class.php | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/webapp/controller/BigwheelController.class.php b/webapp/controller/BigwheelController.class.php index 19c2f9d5..c59186f1 100644 --- a/webapp/controller/BigwheelController.class.php +++ b/webapp/controller/BigwheelController.class.php @@ -245,6 +245,21 @@ class BigwheelController extends BaseAuthedController { } array_push($data['grid_list'], $grid1); array_push($data['grid_list'], $grid2); + + $costItems = array( + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => $costItemNum + ), + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); + $this->propertyChgService->addUserChg(); + myself()->_addItems($hashItems, $this->awardService, $this->propertyChgService); myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); { @@ -267,6 +282,52 @@ class BigwheelController extends BaseAuthedController { { $key = $this->getMidDataKey(); $data = $this->getAndCreateData($key); + $gridRef = null; + $gridId = getReqVal('grid_id', 0); + $this->getGridRefByGridId($data, $gridId, $gridRef); + error_log(json_encode($gridRef)); + if (empty($gridRef) || + $gridRef['grid_state'] != 2) { + myself()->_rspErr(1, 'cant buy'); + return; + } + $costItems = array( + array( + 'item_id' => V_ITEM_DIAMOND, + 'item_num' => $gridRef['buy_price'] + ), + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } + $this->_decItems($costItems); + $gridRef['grid_state'] = 1; + foreach ($data['grid_list'] as &$grid) { + if ($grid['grid_id'] == $gridId) { + $grid['grid_state'] = 1; + } + } + error_log(json_encode($gridRef)); + error_log(json_encode($data)); + myself()->_callModelStatic('MidData', 'setData', $key, json_encode($data)); + $this->awardService->addItem($gridRef['item_id'], $gridRef['item_num']); + $this->propertyChgService->addUserChg(); + + $priceInfo = $this->getPriceInfo($data['drawed_times']); + if (empty($priceInfo)) { + myself()->_rspErr(500, 'server internal error'); + return; + } + $info = array(); + $this->fillInfo($info, $data, $priceInfo); + + myself()->_rspData(array( + 'award' => $this->awardService->toDto(), + 'property_chg' => $this->propertyChgService->toDto(), + 'info' => $info + )); } private function getMidDataKey() From 66b61549962c9993ec72c2adae8bcc477f739580 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 18:45:25 +0800 Subject: [PATCH 14/16] 1 --- webapp/controller/GMController.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webapp/controller/GMController.class.php b/webapp/controller/GMController.class.php index 5f1cdec3..cf77465c 100644 --- a/webapp/controller/GMController.class.php +++ b/webapp/controller/GMController.class.php @@ -62,6 +62,9 @@ class GMController extends BaseAuthedController { }, '.loot' => function () use($params) { $this->lootTest($params); + }, + '.clear_big_wheel' => function () use($params) { + $this->clearBigWheel($params); } ); $func = getXVal($cmdHash, $cmd); @@ -82,6 +85,7 @@ class GMController extends BaseAuthedController { .setsystime //设置服务器时间,示例:.setsystime 2021-12-08 00:00:00 .reset_mission //重置任务 .loot 索引ID 次数 //测试掉落系统数据,示例:.loot 1030 10 +.clear_big_wheel clear big wheel data END )); } @@ -282,4 +286,9 @@ END )); } + private function clearBigWheel($params){ + $key = myself()->_getModelConstant('MidData', 'BIG_WHEEL_TYPE'); + myself()->_callModelStatic('MidData', 'setData', $key, json_encode(array())); + myself()->_rspOk(); + } } From e7ccaa9b684187acff15bf7c5a30c4a22ab39dc7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 19:03:34 +0800 Subject: [PATCH 15/16] 1 --- doc/AAMarket.py | 22 +++++++++++++++++++++- sql/bcnftdb.sql | 4 +++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/AAMarket.py b/doc/AAMarket.py index de0fd897..0a6e1191 100644 --- a/doc/AAMarket.py +++ b/doc/AAMarket.py @@ -300,8 +300,11 @@ class AAMarket(object): ], 'response': [ _common.RspHead(), + ['nickname', '', '昵称'], + ['email', '', 'email'], ['contribution_point', 0, '贡献点'], - ['gold', 0, '金币数'], + ['gold', '', '金币数'], + ['diamond', '', '钻石数'], ] }, { @@ -333,6 +336,23 @@ class AAMarket(object): ], '数据'], ] }, + { + 'method': 'GET', + 'name': '/api/activity/diamond/history/:account_address', + 'desc': '钻石-充值/消费记录', + 'group': '!AAMarket', + 'url': '/api/activity/diamond/history/:account_address', + 'params': [ + ], + 'response': [ + _common.RspHead(), + ['!rows', [ + ['type', 0, '0:充值 1:消费'], + ['date', 0, 'utc时间'], + ['amount', '', '数量'], + ], '数据'], + ] + }, { 'method': 'GET', 'name': '/api/chain/txhash/:net_id/:txhash', diff --git a/sql/bcnftdb.sql b/sql/bcnftdb.sql index 8ad37293..3c031680 100644 --- a/sql/bcnftdb.sql +++ b/sql/bcnftdb.sql @@ -320,6 +320,7 @@ DROP TABLE IF EXISTS `t_recharge_order`; CREATE TABLE `t_recharge_order` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `order_id` varchar(255) COMMENT '订单号', + `short_order_id` varchar(60) COMMENT '短订单号-客户端显示用', `account_address` varchar(60) NOT NULL COMMENT '钱包地址', `currency_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址', `currency_name` varchar(60) NOT NULL DEFAULT '' COMMENT '货币名称', @@ -330,7 +331,8 @@ CREATE TABLE `t_recharge_order` ( `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `order_id` (`order_id`) + UNIQUE KEY `order_id` (`order_id`), + UNIQUE KEY `short_order_id` (`short_order_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; From 425a9898bd6477c45d028e6a71b2c387960e0b04 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 1 Aug 2024 19:08:18 +0800 Subject: [PATCH 16/16] 1 --- doc/README.php | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/README.php b/doc/README.php index b947f10e..dae61359 100644 --- a/doc/README.php +++ b/doc/README.php @@ -18,6 +18,7 @@ * @apiSuccessExample {json} Success-Response: * 2024/07/25 * c=Bag&a=useItemS + * 2024/08/01 * c=Bag&a=buyItemS * c=Avatar&a=buyAvatarS * c=Chip&a=upgradeQualityS