Merge branch 'james_bc' of git.kingsome.cn:server/game2006api into james_bc

This commit is contained in:
hujiabin 2022-12-06 11:33:46 +08:00
commit c730e061d1
4 changed files with 68 additions and 6 deletions

View File

@ -2,6 +2,22 @@
import _common
class NftIntro(object):
def __init__(self):
self.fields = [
['idx', 0, 'idx'],
['token_id', '', 'token_id'],
['token_type', 0, 'nft类型 1:英雄 2:枪支 3:芯片'],
['createtime', 0, '创建时间(上架时间)'],
['modifytime', 0, '修改时间(更新价格等)'],
['s_price', 0, '出售价格-暂定'],
['c_name', '', '缓存-名称'],
['c_job', 0, '缓存-职业'],
['c_lv', 0, '缓存-级别'],
['c_id', 0, '缓存-idx'],
['details', _common.NftDetail(), 'nft列表'],
]
class Market(object):
def __init__(self):
@ -310,7 +326,7 @@ class Market(object):
['total', 0, '出售的列表总数量(当前过滤配置)'],
['start', 0, '有效的分页偏移'],
['page_size', 0, '有效的分页大小'],
['!nfts', [_common.NftDetail()], 'nft列表'],
['!nfts', [NftIntro()], 'nft列表'],
]
},
]

View File

@ -8,7 +8,7 @@ function add(name) {
function init() {
add('fragment');
add('damping');
//add('season');
add('season');
add('feeback');
}

View File

@ -7,6 +7,7 @@ const constant = require('../constant');
class Season {
seasonList = [];
async start() {
console.log("season ranking start1");
while (true) {
await this.doRoutine(utils.getUtcTime());
const nowTime = utils.getUtcTime();
@ -18,7 +19,7 @@ class Season {
async doRoutine(nowTime) {
try {
console.log("season ranking start");
console.log("season ranking start2");
// console.time("season ranking");
this.seasonList = [];
metaFactory.traverseMetaList("RankSeason", (config, idx) => {
@ -30,7 +31,7 @@ class Season {
return true;
});
console.log("season ranking");
console.log("season ranking",this.seasonList);
if (this.checkSeasonEnd(nowTime)) {
await this.calcRanking(nowTime);
}
@ -180,4 +181,4 @@ function init() {
(new Season()).start();
}
exports.init = init;
exports.init = init;

View File

@ -551,7 +551,52 @@ class MarketController extends BaseController {
$price_filter = getReqVal('price_filter', '');
$price_filter_array = explode('|', $price_filter);
echo $price_filter_array;
$conn = myself()->_getMysql('');
$rows = SqlHelper::ormSelect(
$conn,
't_market_store'
);
$total = count($rows);
$page_end = $start + $page_size;
if ($page_end > $total)
$page_end = $total;
$nfts = array();
for ($x = $start; $x < $page_end; $x++) {
$row = $rows[$x];
$nftDb = Nft::getNft($row['token_id']);
if (!$nftDb) {
myself()->_rspErr(1, 'nft not exists');
return;
}
$nft = Nft::toDto($nftDb);
$t = $row['token_type'];
switch($t) {
case Nft::HERO_TYPE: {
} break;
case Nft::EQUIP_TYPE: {
} break;
case Nft::CHIP_TYPE: {
} break;
default: {
}
}
$row['details'] = $nft;
array_push($nfts, $row);
}
$this->_rspData(array(
"total" => count($rows),
"start" => $start,
"page_size" => $page_size,
'nfts' => $nfts,
));
}