本文整理汇总了PHP中Period::getPrevPeriod方法的典型用法代码示例。如果您正苦于以下问题:PHP Period::getPrevPeriod方法的具体用法?PHP Period::getPrevPeriod怎么用?PHP Period::getPrevPeriod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Period
的用法示例。
在下文中一共展示了Period::getPrevPeriod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrentPeriod
/**
* Returns current period instance
*
* @return <Doctrine_Object> instance of Period
*/
public static function getCurrentPeriod()
{
$date = Period::getCurPeriodDate();
$oPeriod = PeriodTable::getInstance()->findOneByDate($date);
if (!$oPeriod instanceof Period) {
// выставить новые тарифы на новый период
UserTable::setNewTariffs();
$oPeriod = new Period();
// вычислить стоимость 1к знаков
if (($prev = Period::getPrevPeriod()) === false) {
$price1k = SettingTable::getOptionByName('price1k')->getValue();
} else {
// рассчитать веса пользователей
UserTable::countWeights($prev);
if (($price1k = VoteTable::getVoted1k($prev)) === false) {
$price1k = $prev->get1k();
}
}
$oPeriod->set1k(number_format((double) $price1k, 2));
// выставить процент
$oPeriod->setR2rShare(number_format(Setting::getValueByName('percent_r2r'), 2, '.', ''));
// --
$oPeriod->setDate($date);
$oPeriod->save();
//throw new sfException('Cannot get current period. Error in DB data');
}
return $oPeriod;
}
示例2: slot
<?php
slot('currentPage', 'profile_p_invoice');
slot('title_page', 'Personal room - Личный кабинет');
include_partial('profilep/profMenu');
?>
<table id=count_data cellpadding="0" cellspacing="0">
<tr class=yg>
<td class=left>
<p>Расчетный период</p>
</td>
<td class=center>
<p><?php
echo Period::periodMonthString(Period::getPrevPeriod());
?>
</p>
</td>
<td class=right>
<p> </p>
</td>
</tr>
<tr class=g>
<td class=left>
<p>К выплате</p>
</td>
<td class=center>
<p class=pay_out>
<?php
if (!is_null($earnedPrev)) {
?>
<?php
示例3: executeInvoice
/**
* Executes invoice action
*
* @param sfWebRequest $request
*/
public function executeInvoice(sfWebRequest $request)
{
$this->period = Period::getCurrentPeriod();
$this->user = $this->getUser()->getGuardUser();
$this->form = null;
$this->form_type = '';
$this->earned = $this->user->getUserBalanceByPeriodId(Period::getCurrentPeriod()->getId())->getPayable();
$this->earnedPrev = $this->user->getUserBalanceByPeriodId(Period::getPrevPeriod()->getId());
if ($request->getMethod() == 'POST') {
$this->form = new UserPasswordImgForm($this->user);
if ($this->processPswChangeForm($request, $this->form)) {
// Input purchase ID
$this->form_type = 'account_number';
$this->form = new AccountNumberForm($this->user);
$this->fieldName = 'account_number';
$this->titleName = 'Номер кошелька';
$this->cssId = 'account_number';
} else {
$this->error_img = true;
$this->form_type = 'secure_img';
$this->fieldName = 'account_number';
$this->titleName = 'Изменение номера кошелька';
$this->cssId = 'account_number';
}
}
}