Merge branch 'james_bc' into hjb
This commit is contained in:
commit
44da74f70b
@ -9,6 +9,7 @@ class NftIntro(object):
|
|||||||
['idx', 0, 'idx'],
|
['idx', 0, 'idx'],
|
||||||
['token_id', '', 'token_id'],
|
['token_id', '', 'token_id'],
|
||||||
['token_type', 0, 'nft类型 1:英雄 2:枪支 3:芯片'],
|
['token_type', 0, 'nft类型 1:英雄 2:枪支 3:芯片'],
|
||||||
|
['amount', 0, '堆叠数量'],
|
||||||
['createtime', 0, '创建时间(上架时间)'],
|
['createtime', 0, '创建时间(上架时间)'],
|
||||||
['modifytime', 0, '修改时间(更新价格等)'],
|
['modifytime', 0, '修改时间(更新价格等)'],
|
||||||
['s_price', 0, '出售价格-暂定'],
|
['s_price', 0, '出售价格-暂定'],
|
||||||
@ -368,6 +369,7 @@ class Market(object):
|
|||||||
['token', '', 'token'],
|
['token', '', 'token'],
|
||||||
['nft_token', '', 'nft_token'],
|
['nft_token', '', 'nft_token'],
|
||||||
['s_price', '', '出售价格USDT'],
|
['s_price', '', '出售价格USDT'],
|
||||||
|
['amount', 0, '出售数量'],
|
||||||
['payment_token_address', '', 'payment_token_address'],
|
['payment_token_address', '', 'payment_token_address'],
|
||||||
['nonce', '', 'nonce'],
|
['nonce', '', 'nonce'],
|
||||||
['signature', '', '签名soliditySha3(type, payment_token_address, price, nonce), 签名的replace客户端做处理'],
|
['signature', '', '签名soliditySha3(type, payment_token_address, price, nonce), 签名的replace客户端做处理'],
|
||||||
|
@ -77,6 +77,7 @@ class User(object):
|
|||||||
['guild_id', 0, '跟新工会id(可选参数,不传就不更新)'],
|
['guild_id', 0, '跟新工会id(可选参数,不传就不更新)'],
|
||||||
['guild_job', 0, '跟新工会职位(可选参数,不传就不更新)'],
|
['guild_job', 0, '跟新工会职位(可选参数,不传就不更新)'],
|
||||||
['guild_name', 0, '跟新工会名称(可选参数,不传就不更新)'],
|
['guild_name', 0, '跟新工会名称(可选参数,不传就不更新)'],
|
||||||
|
['parachute', 0, '跟新降落伞(可选参数,不传就不更新)'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
@ -149,6 +149,8 @@ class UserInfo(object):
|
|||||||
['guild_id', '', '工会id'],
|
['guild_id', '', '工会id'],
|
||||||
['guild_job', 0, '工会职位'],
|
['guild_job', 0, '工会职位'],
|
||||||
['guild_name', '', '工会名称'],
|
['guild_name', '', '工会名称'],
|
||||||
|
['parachute', '', '当前使用的降落伞id'],
|
||||||
|
['!parachute_list', [0], '拥有的降落伞列表'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class UserSimple(object):
|
class UserSimple(object):
|
||||||
|
@ -65,6 +65,7 @@ CREATE TABLE `t_user` (
|
|||||||
`guild_id` varchar(60) NOT NULL DEFAULT '' COMMENT '工会id',
|
`guild_id` varchar(60) NOT NULL DEFAULT '' COMMENT '工会id',
|
||||||
`guild_job` int(11) NOT NULL DEFAULT '0' COMMENT '工会职位',
|
`guild_job` int(11) NOT NULL DEFAULT '0' COMMENT '工会职位',
|
||||||
`guild_name` varchar(255) NOT NULL DEFAULT '' COMMENT '工会名称',
|
`guild_name` varchar(255) NOT NULL DEFAULT '' COMMENT '工会名称',
|
||||||
|
`parachute` int(11) NOT NULL DEFAULT '0' COMMENT '降落伞ID',
|
||||||
PRIMARY KEY (`idx`),
|
PRIMARY KEY (`idx`),
|
||||||
UNIQUE KEY `account_id` (`account_id`),
|
UNIQUE KEY `account_id` (`account_id`),
|
||||||
KEY `channel` (`channel`)
|
KEY `channel` (`channel`)
|
||||||
|
@ -884,6 +884,7 @@ class MarketController extends BaseController {
|
|||||||
$token = getReqVal('token', '');
|
$token = getReqVal('token', '');
|
||||||
$nft_token = getReqVal('nft_token', '');
|
$nft_token = getReqVal('nft_token', '');
|
||||||
$s_price = getReqVal('s_price', '');
|
$s_price = getReqVal('s_price', '');
|
||||||
|
$amount = getReqVal('amount', 1);
|
||||||
$payment_token_address = getReqVal('payment_token_address', '');
|
$payment_token_address = getReqVal('payment_token_address', '');
|
||||||
$nonce = getReqVal('nonce', '');
|
$nonce = getReqVal('nonce', '');
|
||||||
$signature = getReqVal('signature', '');
|
$signature = getReqVal('signature', '');
|
||||||
@ -901,6 +902,7 @@ class MarketController extends BaseController {
|
|||||||
'token_id' => $nft_token,
|
'token_id' => $nft_token,
|
||||||
'owner_address' => $nftDetail['owner_address'],
|
'owner_address' => $nftDetail['owner_address'],
|
||||||
'token_type' => $nftDetail['type'],
|
'token_type' => $nftDetail['type'],
|
||||||
|
'amount' => $amount,
|
||||||
'createtime' => myself()->_getNowTime(),
|
'createtime' => myself()->_getNowTime(),
|
||||||
'modifytime' => myself()->_getNowTime(),
|
'modifytime' => myself()->_getNowTime(),
|
||||||
's_price' => $s_price,
|
's_price' => $s_price,
|
||||||
|
@ -486,6 +486,21 @@ class UserController extends BaseAuthedController {
|
|||||||
'valid_func' => function ($val, &$errCode, &$errMsg) {
|
'valid_func' => function ($val, &$errCode, &$errMsg) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
),
|
||||||
|
'parachute' => array(
|
||||||
|
'field_name' => 'parachute',
|
||||||
|
'val_func' => function ($val) {
|
||||||
|
return $val;
|
||||||
|
},
|
||||||
|
'valid_func' => function ($val, &$errCode, &$errMsg) {
|
||||||
|
if (User::isValidParachute($val)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
$errCode = 1;
|
||||||
|
$errMsg = 'parachute parameter error';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$fieldsKv = array();
|
$fieldsKv = array();
|
||||||
|
@ -8,14 +8,25 @@ use mt;
|
|||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
class Parachute extends BaseModel
|
class Parachute extends BaseModel
|
||||||
{
|
{
|
||||||
|
public static $parachute = '170001'; //默认降落伞
|
||||||
|
|
||||||
public static function getMyParachute(){
|
public static function getMyParachute(){
|
||||||
return SqlHelper::ormSelect(
|
$list = array(
|
||||||
|
self::$parachute
|
||||||
|
);
|
||||||
|
$rows = SqlHelper::ormSelect(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_parachute',
|
't_parachute',
|
||||||
array(
|
array(
|
||||||
'account_id' => myself()->_getAccountId(),
|
'account_id' => myself()->_getAccountId(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
if ($rows){
|
||||||
|
foreach ($rows as $row){
|
||||||
|
array_push($list, $row['item_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
}
|
}
|
||||||
public static function addParachute($itemMeta){
|
public static function addParachute($itemMeta){
|
||||||
if ($itemMeta){
|
if ($itemMeta){
|
||||||
|
@ -4,11 +4,13 @@ namespace models;
|
|||||||
|
|
||||||
require_once('mt/Item.php');
|
require_once('mt/Item.php');
|
||||||
require_once('models/UserSeasonRing.php');
|
require_once('models/UserSeasonRing.php');
|
||||||
|
require_once('models/Parachute.php');
|
||||||
|
|
||||||
use mt;
|
use mt;
|
||||||
use phpcommon;
|
use phpcommon;
|
||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
use models\UserSeasonRing;
|
use models\UserSeasonRing;
|
||||||
|
use models\Parachute;
|
||||||
|
|
||||||
class User extends BaseModel {
|
class User extends BaseModel {
|
||||||
|
|
||||||
@ -69,6 +71,8 @@ class User extends BaseModel {
|
|||||||
'guild_id' => $row['guild_id'],
|
'guild_id' => $row['guild_id'],
|
||||||
'guild_job' => $row['guild_job'],
|
'guild_job' => $row['guild_job'],
|
||||||
'guild_name' => $row['guild_name'],
|
'guild_name' => $row['guild_name'],
|
||||||
|
'parachute' => $row['parachute'] ? $row['parachute'] : Parachute::$parachute,
|
||||||
|
'parachute_list' => Parachute::getMyParachute(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,7 +110,9 @@ class User extends BaseModel {
|
|||||||
'guild_id' => $row['guild_id'],
|
'guild_id' => $row['guild_id'],
|
||||||
'guild_job' => $row['guild_job'],
|
'guild_job' => $row['guild_job'],
|
||||||
'guild_name' => $row['guild_name'],
|
'guild_name' => $row['guild_name'],
|
||||||
'ring_list' => UserSeasonRing::ringList($row['account_id'])
|
'ring_list' => UserSeasonRing::ringList($row['account_id']),
|
||||||
|
'parachute' => $row['parachute'] ? $row['parachute'] : Parachute::$parachute,
|
||||||
|
'parachute_list' => Parachute::getMyParachute(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,6 +156,11 @@ class User extends BaseModel {
|
|||||||
return in_array($headFrame, $headFrameList);
|
return in_array($headFrame, $headFrameList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function isValidParachute($parachute){
|
||||||
|
$parachuteList = Parachute::getMyParachute();
|
||||||
|
return in_array($parachute, $parachuteList);
|
||||||
|
}
|
||||||
|
|
||||||
private static function getHeadList($userInfo)
|
private static function getHeadList($userInfo)
|
||||||
{
|
{
|
||||||
$headList = emptyReplace(json_decode($userInfo['head_list'], true), array());
|
$headList = emptyReplace(json_decode($userInfo['head_list'], true), array());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user