52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
|
|
namespace models;
|
|
|
|
require_once('mt/Item.php');
|
|
|
|
use mt;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class MissionStar extends BaseModel
|
|
{
|
|
const RECEIVEABLE_STATE = 0;
|
|
const RECEIVED_STATE = 1;
|
|
const NOT_FINISHED_STATE = -1;
|
|
|
|
public static function find($seasonId,$missionId){
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getSelfMysql(),
|
|
't_mission_star',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
'mission_id' => $missionId,
|
|
)
|
|
);
|
|
return $row;
|
|
}
|
|
|
|
public static function add($seasonId,$missionId){
|
|
SqlHelper::upsert(
|
|
myself()->_getSelfMysql(),
|
|
't_mission_star',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
'mission_id' => $missionId
|
|
),
|
|
array(
|
|
|
|
),
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
'mission_id' => $missionId,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime()
|
|
)
|
|
);
|
|
}
|
|
|
|
} |