Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2699be5296 | ||
![]() |
2f75aa1e1d | ||
![]() |
2c1f98ad82 |
@ -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,
|
||||||
|
42
webapp/controller/OutAppNftController.class.php
Normal file
42
webapp/controller/OutAppNftController.class.php
Normal 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,
|
||||||
|
));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
27
webapp/mt/ActivityRewards.php
Normal file
27
webapp/mt/ActivityRewards.php
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user