This commit is contained in:
hujiabin 2024-08-01 19:18:47 +08:00
parent 79acc95aa9
commit 7d02ff175d
7 changed files with 30 additions and 22 deletions

View File

@ -15,7 +15,11 @@ use services\AwardService;
use services\PropertyChgService; use services\PropertyChgService;
class FirstTopupController extends BaseAuthedController { class FirstTopupController extends BaseAuthedController {
public function _handlePre()
{
parent::_handlePre();
die;
}
public function info() public function info()
{ {
$dbInfo = FirstTopup::get(); $dbInfo = FirstTopup::get();

View File

@ -34,13 +34,13 @@ class HashRateController extends BaseAuthedController
$mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService); $mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService);
foreach ($mateList as $mate) { foreach ($mateList as $mate) {
$taskDb = HashRate::find($mate['id'],$currentPeriod['id']); $taskDb = HashRate::find($mate['id'],$currentPeriod['id']);
$taskDto = $this->hashRateService->hashRateTaskDto($mate,$taskDb); $taskDto = $this->hashRateService->hashRateTaskDto($mate,$taskDb,$currentPeriod['id']);
array_push($taskDtoList1, $taskDto); array_push($taskDtoList1, $taskDto);
} }
$mateList2 = \mt\AchievementsPower::getListByType(\mt\AchievementsPower::TYPE5); $mateList2 = \mt\AchievementsPower::getListByType(\mt\AchievementsPower::TYPE5);
foreach ($mateList2 as $mate) { foreach ($mateList2 as $mate) {
$taskDb = HashRate::find($mate['id'],$currentPeriod['id']); $taskDb = HashRate::find($mate['id'],$currentPeriod['id']);
$taskDto = $this->hashRateService->hashRateTaskDto($mate,$taskDb); $taskDto = $this->hashRateService->hashRateTaskDto($mate,$taskDb,$currentPeriod['id']);
array_push($taskDtoList2, $taskDto); array_push($taskDtoList2, $taskDto);
} }
$obtain_start_time = strtotime($currentPeriod['obtain_start_time']); $obtain_start_time = strtotime($currentPeriod['obtain_start_time']);
@ -80,7 +80,7 @@ class HashRateController extends BaseAuthedController
return; return;
} }
$taskDb = HashRate::find($taskMeta['id'],$currentPeriod['id']); $taskDb = HashRate::find($taskMeta['id'],$currentPeriod['id']);
$taskDto = $this->hashRateService->hashRateTaskDto($taskMeta,$taskDb); $taskDto = $this->hashRateService->hashRateTaskDto($taskMeta,$taskDb,$currentPeriod['id']);
if (!$taskDto) { if (!$taskDto) {
$this->_rspErr(10, 'server internal error'); $this->_rspErr(10, 'server internal error');

View File

@ -13,7 +13,11 @@ use models\Hero;
class MarketController extends BaseAuthedController { class MarketController extends BaseAuthedController {
public function _handlePre()
{
parent::_handlePre();
die;
}
public function productList() public function productList()
{ {
$page = getReqVal('page', 1); $page = getReqVal('page', 1);

View File

@ -37,6 +37,7 @@ class MissionController extends BaseAuthedController {
public function _handlePre() public function _handlePre()
{ {
parent::_handlePre(); parent::_handlePre();
die;
DynData::preload(); DynData::preload();
// $this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason(); // $this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason();
// if (!$this->currRankSeasonMeta) { // if (!$this->currRankSeasonMeta) {

View File

@ -44,6 +44,7 @@ class ShopController extends BaseAuthedController {
) { ) {
parent::_handlePre(); parent::_handlePre();
} }
die();
} }
public function getGoodsList() public function getGoodsList()

View File

@ -19,6 +19,18 @@ class HashRate extends BaseModel
); );
} }
public static function getCount($period){
$rows = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_hash_rate',
array(
'account_id' => myself()->_getAccountId(),
'period' => $period,
)
);
return count($rows);
}
public static function add($taskId,$period){ public static function add($taskId,$period){
SqlHelper::upsert( SqlHelper::upsert(

View File

@ -96,7 +96,7 @@ class HashRateService extends BaseService
public function hashRateTaskDto($taskMate, $taskDb){ public function hashRateTaskDto($taskMate, $taskDb,$period){
$taskDto = array( $taskDto = array(
'task_id' => $taskMate['id'], 'task_id' => $taskMate['id'],
'current' => 0, 'current' => 0,
@ -254,27 +254,13 @@ class HashRateService extends BaseService
break; break;
//累计完成任务数 //累计完成任务数
case \mt\AchievementsPower::TOTAL_COMPLETE_NUM : { case \mt\AchievementsPower::TOTAL_COMPLETE_NUM : {
//.......... $taskDto['current'] = HashRate::getCount($period);
} }
break; break;
} }
if ($taskDto['current'] >= $taskDto['target']) { if ($taskDto['current'] >= $taskDto['target']) {
$taskDto['current'] = $taskDto['target']; $taskDto['current'] = $taskDto['target'];
$taskDto['state'] = self::FINISHED_STATE; $taskDto['state'] = self::FINISHED_STATE;
// if ($currentPeriod){
// $hashRateDb = HashRate::find($taskMate['id'],$currentPeriod['id']);
// if (!$hashRateDb){
// $fieldKv = array(
// 'account_id' => myself()->_getAccountId(),
// 'task_id' => $taskMate['id'],
// 'period' => $currentPeriod['id'],
// 'reward' => $taskMate['Reward_quantity'],
// 'createtime' => myself()->_getNowTime(),
// 'modifytime' => myself()->_getNowTime()
// );
// HashRate::add($fieldKv);
// }
// }
} }
return $taskDto; return $taskDto;
} }
@ -383,7 +369,7 @@ class HashRateService extends BaseService
foreach ($item as $task){ foreach ($item as $task){
$taskMeta = AchievementsPower::find($task['task_id']); $taskMeta = AchievementsPower::find($task['task_id']);
$taskDb = HashRate::find($task['task_id'],$period); $taskDb = HashRate::find($task['task_id'],$period);
$taskDto = $this->hashRateTaskDto($taskMeta,$taskDb); $taskDto = $this->hashRateTaskDto($taskMeta,$taskDb,$period);
if ($taskDto['state'] == self::FINISHED_STATE){ if ($taskDto['state'] == self::FINISHED_STATE){
return true; return true;
} }