diff --git a/doc/Chip.py b/doc/Chip.py index 4e5a267f..a77aca76 100644 --- a/doc/Chip.py +++ b/doc/Chip.py @@ -142,6 +142,42 @@ class Chip(object): _common.RspHead(), ['!data', [_common.Chip()], '芯片信息'] ] + },{ + 'name': 'isNeedLucky', + 'desc': '选择需要幸运值', + 'group': 'Chip', + 'url': 'webapp/index.php?c=Chip&a=isNeedLucky', + 'params': [ + _common.ReqHead(), + ['token_id', '', '源芯片token id'], + ], + 'response': [ + _common.RspHead(), + ] + },{ + 'name': 'isNotNeedLucky', + 'desc': '放弃幸运值', + 'group': 'Chip', + 'url': 'webapp/index.php?c=Chip&a=isNotNeedLucky', + 'params': [ + _common.ReqHead(), + ['token_id', '', '源芯片token id'], + ], + 'response': [ + _common.RspHead(), + ] + },{ + 'name': 'waitingLucky', + 'desc': '幸运值未做选择-待定阶段', + 'group': 'Chip', + 'url': 'webapp/index.php?c=Chip&a=waitingLucky', + 'params': [ + _common.ReqHead(), + ['token_id', '', '源芯片token id'], + ], + 'response': [ + _common.RspHead(), + ] }, diff --git a/doc/_common.py b/doc/_common.py index b3dc0288..7ff0de5a 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -666,9 +666,11 @@ class Chip(object): ['supper_state', 0, '是否锁定:0 正常;1 锁住'], ['inlay_state', 0, '镶嵌状态:0 未镶嵌;1 镶嵌了'], ['!rand_attr', [ChipAttr()], '属性'], - ['lucky_temporary', '', '临时幸运值'], + ['lucky_temporary', '', '升级成功所需增加的幸运值'], ['lucky_final', '', '最终幸运值'], - ['strength', '', '体力值'], + ['strength', '', '最终体力值'], + ['strength_temporary', '', '升级成功所得出的总体力值'], + ] class ChipPro(object): diff --git a/webapp/controller/ChipController.class.php b/webapp/controller/ChipController.class.php index 45ec0801..3f38f241 100644 --- a/webapp/controller/ChipController.class.php +++ b/webapp/controller/ChipController.class.php @@ -220,8 +220,8 @@ class ChipController extends BaseAuthedController public function syntheticChip(){ $token_id_main = trim(getReqVal('token_id_main', 0)); - $token_id_param = getReqVal('token_id_param', 0); - if (! $token_id_main || ! $token_id_param) { + $token_id_param = explode(' ',getReqVal('token_id_param', 0)); + if (! $token_id_main || count($token_id_param)<=0 ) { $this->_rspErr(1, 'Please enter instructions'); return; } @@ -281,6 +281,20 @@ class ChipController extends BaseAuthedController $this->_rspOk(); } + public function waitingLucky(){ + $token_id = trim(getReqVal('token_id', 0)); + if (! $token_id) { + $this->_rspErr(1, 'Please enter instructions'); + return; + } + $chip = Chip::getChipByTokenId($token_id); + $fieldsKv = [ + 'supper_state'=>1, + ]; + Chip::update($chip['token_id'],$fieldsKv); + $this->_rspOk(); + } + public function aKeySynthetic(){ } @@ -288,7 +302,7 @@ class ChipController extends BaseAuthedController public function test(){ - $chip = Chip::getChipByTokenId(1660629360); + $chip = Chip::getChipByTokenId(1660629357); print_r($chip); }