芯片功能初版

This commit is contained in:
hujiabin 2022-08-18 19:48:24 +08:00
parent 260d91a513
commit 1c38233e4e
3 changed files with 57 additions and 5 deletions

View File

@ -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(),
]
},

View File

@ -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):

View File

@ -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);
}