_getSelfMysql(), 't_season', array( 'account_id' => myself()->_getAccountId(), 'season_id' => $seasonId, 'type' => $type, 'card_lv' => $cardLv, ) ); return $row; } public static function toDto($row) { return array( ); } public static function all($seasonId) { $rows = SqlHelper::ormSelect( myself()->_getSelfMysql(), 't_season_card', array( 'account_id' => myself()->_getAccountId(), 'season_id' => $seasonId, ) ); return array_map(function($row) { $nowDaySeconds = myself()->_getNowDaySeconds(); $mondaySeconds = myself()->_getMondaySeconds(); return $row; }, $rows); } public static function allHash($seasonId, $type) { $cardHash = array(); foreach (self::all($seasonId) as $row) { if ($row['type'] == $type) { $cardHash[$row['card_lv']] = $row; } } return $cardHash; } public function add($seasonId, $type, $cardLv) { $initSeasonCard = mt\SeasonCard::getInitCard(); SqlHelper::upsert( myself()->_getSelfMysql(), 't_season_card', array( 'account_id' => myself()->_getAccountId(), 'season_id' => $seasonId, 'type' => $type, 'card_lv' => $cardLv, ), array( ), array( 'account_id' => myself()->_getAccountId(), 'season_id' => $seasonId, 'type' => $type, 'card_lv' => $cardLv, 'reward_received' => 1, 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime() ) ); } }