Compare commits

...

3 Commits

Author SHA1 Message Date
hujiabin
2699be5296 1 2024-01-31 11:25:10 +08:00
aozhiwei
2f75aa1e1d 1 2024-01-29 16:46:57 +08:00
aozhiwei
2c1f98ad82 1 2024-01-29 14:21:24 +08:00
4 changed files with 84 additions and 0 deletions

View File

@ -3,6 +3,7 @@
require_once('services/MissionService.php'); require_once('services/MissionService.php');
require_once('mt/RankSeason.php'); require_once('mt/RankSeason.php');
require_once('mt/HashRateCommon.php'); require_once('mt/HashRateCommon.php');
require_once('mt/ActivityRewards.php');
require_once('models/Mission.php'); require_once('models/Mission.php');
require_once('models/Fragment.php'); require_once('models/Fragment.php');
@ -156,6 +157,19 @@ class OtherController extends BaseAuthedController {
)); ));
} }
} }
$rewards = \mt\ActivityRewards::find(myself()->_getAccountId());
if ($rewards){
foreach ($rewards as $reward){
array_push($historyList, array(
"type" => -1,
"event_name" => $reward['event_name'],
"cecVal" => $reward['cec'],
"createtime" => strtotime($reward['time'])
));
}
}
$this->_rspData(array( $this->_rspData(array(
'cec'=>$totalCecVal, 'cec'=>$totalCecVal,
'list'=>$historyList, 'list'=>$historyList,

View File

@ -0,0 +1,42 @@
<?php
use phpcommon\SqlHelper;
require_once('models/Nft.php');
use models\Nft;
class OutAppNftController extends BaseController {
public function getNftList(){
$address = getReqVal('address', '');
$type = getReqVal('type', '');
if ($type){
$nftList = Nft::getNftListByType($address,$type);
}else{
$nftList = Nft::getNftList($address);
}
$listInfo = array();
if ($nftList){
foreach ($nftList as $nft) {
$image = 'https://www.cebg.games/res/avatars/' . $nft['item_id'] . '.png';
$full_image = 'https://www.cebg.games/res/avatars/full_' . $nft['item_id'] . '.png';
$info = array(
"idx" => $nft['idx'],
"owner_address" => $nft['owner_address'],
"item_id" => $nft['item_id'],
"token_id" => $nft['token_id'],
"token_type" => $nft['token_type'],
"contract_address" => $nft['contract_address'],
'image' => $image,
'full_image' => $full_image,
"details" => array(),
);
array_push($listInfo,$info);
}
}
$this->_rspData(array(
'nfts' => $listInfo,
));
}
}

View File

@ -272,6 +272,7 @@ class Staking extends BaseModel {
if ($stakedDays >= $saveDays) { if ($stakedDays >= $saveDays) {
$rate = 1; $rate = 1;
} }
$rate = 1;
if ($saveDays >= 30 * 12 * 2) { if ($saveDays >= 30 * 12 * 2) {
$stakedDays = max($stakedDays, 0); $stakedDays = max($stakedDays, 0);
$dto['cec_rewards'] = ($dto['cec_value'] * (0.6 / 30 / 12)) * min(30 * 12, $stakedDays) * $rate; $dto['cec_rewards'] = ($dto['cec_value'] * (0.6 / 30 / 12)) * min(30 * 12, $stakedDays) * $rate;

View File

@ -0,0 +1,27 @@
<?php
namespace mt;
class ActivityRewards
{
public static function find($account){
$data = array();
foreach (self::getMetaList() as $mate){
if ($mate['account_id'] == $account){
array_push($data,$mate);
}
}
return $data;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('ActivityRewards@ActivityRewards.php');
}
return self::$metaList;
}
protected static $metaList;
}