本文整理汇总了PHP中PilotData::UpdatePilotPay方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::UpdatePilotPay方法的具体用法?PHP PilotData::UpdatePilotPay怎么用?PHP PilotData::UpdatePilotPay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PilotData
的用法示例。
在下文中一共展示了PilotData::UpdatePilotPay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: approve_pirep_post
/**
* Approve the PIREP, and then update
* the pilot's data
*/
protected function approve_pirep_post()
{
$pirepid = $this->post->id;
if ($pirepid == '') {
return;
}
$pirep_details = PIREPData::GetReportDetails($pirepid);
# See if it's already been accepted
if (intval($pirep_details->accepted) == PIREP_ACCEPTED) {
return;
}
# Update pilot stats
SchedulesData::IncrementFlownCount($pirep_details->code, $pirep_details->flightnum);
PIREPData::ChangePIREPStatus($pirepid, PIREP_ACCEPTED);
// 1 is accepted
PilotData::UpdateFlightData($pirep_details->pilotid, $pirep_details->flighttime, 1);
PilotData::UpdatePilotPay($pirep_details->pilotid, $pirep_details->flighttime);
RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
PilotData::GenerateSignature($pirep_details->pilotid);
StatsData::UpdateTotalHours();
LogData::addLog(Auth::$userinfo->pilotid, 'Approved PIREP #' . $pirepid);
# Call the event
CodonEvent::Dispatch('pirep_accepted', 'PIREPAdmin', $pirep_details);
}
示例2: approveall
public function approveall()
{
echo '<h3>Approve All</h3>';
$allpireps = PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING));
$total = count($allpireps);
$count = 0;
foreach ($allpireps as $pirep_details) {
if ($pirep_details->aircraft == '') {
continue;
}
# Update pilot stats
SchedulesData::IncrementFlownCount($pirep_details->code, $pirep_details->flightnum);
PIREPData::ChangePIREPStatus($pirep_details->pirepid, PIREP_ACCEPTED);
// 1 is accepted
//PilotData::UpdateFlightData($pirep_details->pilotid, $pirep_details->flighttime, 1);
PilotData::UpdatePilotStats($pirep_details->pilotid);
PilotData::UpdatePilotPay($pirep_details->pilotid, $pirep_details->flighttime);
RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
RanksData::CalculatePilotRanks();
PilotData::GenerateSignature($pirep_details->pilotid);
StatsData::UpdateTotalHours();
$count++;
}
$skipped = $total - $count;
echo "{$count} of {$total} were approved ({$skipped} has errors)";
}