63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
|
|
|
|
namespace models;
|
|
|
|
use mt;
|
|
use phpcommon\SqlHelper;
|
|
class CircuitReward extends BaseModel
|
|
{
|
|
public static function find($address, $season, $stage){
|
|
return SqlHelper::ormSelectOne(
|
|
myself()->_getMysql(''),
|
|
't_circuit_reward',
|
|
array(
|
|
'address' => $address,
|
|
'season' => $season,
|
|
'stage' => $stage
|
|
)
|
|
);
|
|
}
|
|
|
|
public static function _verifySettlement($season,$stage){
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getMysql(''),
|
|
't_circuit_reward',
|
|
array(
|
|
'season' => $season,
|
|
'stage' => $stage
|
|
)
|
|
);
|
|
if ($row){
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static function add($account,$address,$season,$stage,$ranking,$rewardNum){
|
|
SqlHelper::upsert(
|
|
myself()->_getMysql(''),
|
|
't_circuit_reward',
|
|
array(
|
|
'account_id' => $account,
|
|
'season' => $season,
|
|
'stage' => $stage
|
|
),
|
|
array(
|
|
|
|
),
|
|
array(
|
|
'account_id' => $account,
|
|
'address' => $address,
|
|
'season' => $season,
|
|
'stage' => $stage,
|
|
'ranking' => $ranking,
|
|
'reward_num' => $rewardNum,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime(),
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|