1
This commit is contained in:
parent
79acc95aa9
commit
7d02ff175d
@ -15,7 +15,11 @@ use services\AwardService;
|
||||
use services\PropertyChgService;
|
||||
|
||||
class FirstTopupController extends BaseAuthedController {
|
||||
|
||||
public function _handlePre()
|
||||
{
|
||||
parent::_handlePre();
|
||||
die;
|
||||
}
|
||||
public function info()
|
||||
{
|
||||
$dbInfo = FirstTopup::get();
|
||||
|
@ -34,13 +34,13 @@ class HashRateController extends BaseAuthedController
|
||||
$mateList = \mt\AchievementsPower::getCustomTypeMetaList($type,$this->hashRateService);
|
||||
foreach ($mateList as $mate) {
|
||||
$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);
|
||||
}
|
||||
$mateList2 = \mt\AchievementsPower::getListByType(\mt\AchievementsPower::TYPE5);
|
||||
foreach ($mateList2 as $mate) {
|
||||
$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);
|
||||
}
|
||||
$obtain_start_time = strtotime($currentPeriod['obtain_start_time']);
|
||||
@ -80,7 +80,7 @@ class HashRateController extends BaseAuthedController
|
||||
return;
|
||||
}
|
||||
$taskDb = HashRate::find($taskMeta['id'],$currentPeriod['id']);
|
||||
$taskDto = $this->hashRateService->hashRateTaskDto($taskMeta,$taskDb);
|
||||
$taskDto = $this->hashRateService->hashRateTaskDto($taskMeta,$taskDb,$currentPeriod['id']);
|
||||
|
||||
if (!$taskDto) {
|
||||
$this->_rspErr(10, 'server internal error');
|
||||
|
@ -13,7 +13,11 @@ use models\Hero;
|
||||
|
||||
|
||||
class MarketController extends BaseAuthedController {
|
||||
|
||||
public function _handlePre()
|
||||
{
|
||||
parent::_handlePre();
|
||||
die;
|
||||
}
|
||||
public function productList()
|
||||
{
|
||||
$page = getReqVal('page', 1);
|
||||
|
@ -37,6 +37,7 @@ class MissionController extends BaseAuthedController {
|
||||
public function _handlePre()
|
||||
{
|
||||
parent::_handlePre();
|
||||
die;
|
||||
DynData::preload();
|
||||
// $this->currRankSeasonMeta = mt\RankSeason::getCurrentSeason();
|
||||
// if (!$this->currRankSeasonMeta) {
|
||||
|
@ -44,6 +44,7 @@ class ShopController extends BaseAuthedController {
|
||||
) {
|
||||
parent::_handlePre();
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
public function getGoodsList()
|
||||
|
@ -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){
|
||||
SqlHelper::upsert(
|
||||
|
@ -96,7 +96,7 @@ class HashRateService extends BaseService
|
||||
|
||||
|
||||
|
||||
public function hashRateTaskDto($taskMate, $taskDb){
|
||||
public function hashRateTaskDto($taskMate, $taskDb,$period){
|
||||
$taskDto = array(
|
||||
'task_id' => $taskMate['id'],
|
||||
'current' => 0,
|
||||
@ -254,27 +254,13 @@ class HashRateService extends BaseService
|
||||
break;
|
||||
//累计完成任务数
|
||||
case \mt\AchievementsPower::TOTAL_COMPLETE_NUM : {
|
||||
//..........
|
||||
$taskDto['current'] = HashRate::getCount($period);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ($taskDto['current'] >= $taskDto['target']) {
|
||||
$taskDto['current'] = $taskDto['target'];
|
||||
$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;
|
||||
}
|
||||
@ -383,7 +369,7 @@ class HashRateService extends BaseService
|
||||
foreach ($item as $task){
|
||||
$taskMeta = AchievementsPower::find($task['task_id']);
|
||||
$taskDb = HashRate::find($task['task_id'],$period);
|
||||
$taskDto = $this->hashRateTaskDto($taskMeta,$taskDb);
|
||||
$taskDto = $this->hashRateTaskDto($taskMeta,$taskDb,$period);
|
||||
if ($taskDto['state'] == self::FINISHED_STATE){
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user