本文整理汇总了PHP中Tax::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Tax::model方法的具体用法?PHP Tax::model怎么用?PHP Tax::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tax
的用法示例。
在下文中一共展示了Tax::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadModel
/**
* Returns the data model based on the primary key given in the GET variable.
* If the data model is not found, an HTTP exception will be raised.
* @param integer the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Tax::model()->findByPk((int) $id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例2: array
?>
<?php
echo $form->textArea($model, 'description', array('rows' => 6, 'cols' => 50));
?>
<?php
echo $form->error($model, 'description');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'tax_id');
?>
<?php
echo $form->dropDownList($model, 'tax_id', CHtml::listData(Tax::model()->findAll(), 'id', 'title'));
?>
<?php
echo $form->error($model, 'tax_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'price');
?>
<?php
echo $form->textField($model, 'price');
?>
<?php
echo $form->error($model, 'price');
示例3: __get
public function __get($strName)
{
switch ($strName) {
case 'completed':
return "nothing";
return $this->carts(array('scopes' => array('complete')));
case 'DatetimeCreated':
return date(_xls_get_conf('DATE_FORMAT', 'Y-m-d'), strtotime($this->datetime_cre));
case 'cartitems':
return $this->cartItems;
case 'Length':
return $this->GetLength();
case 'Height':
return $this->GetHeight();
case 'Width':
return $this->GetWidth();
case 'Weight':
return $this->GetWeight();
case 'HasShippableGift':
return $this->HasShippableGift();
case 'GiftAddress':
return $this->GiftAddress();
case 'SubTotalTaxIncIfSet':
QApplication::Log(E_USER_NOTICE, 'legacy', $strName);
return $this->Subtotal;
case 'tax1name':
case 'tax1Name':
return Tax::TaxByLsid(1);
case 'tax2name':
case 'tax2Name':
return Tax::TaxByLsid(2);
case 'tax3name':
case 'tax3Name':
return Tax::TaxByLsid(3);
case 'tax4name':
case 'tax4Name':
return Tax::TaxByLsid(4);
case 'tax5name':
case 'tax5Name':
return Tax::TaxByLsid(5);
case 'tax_total':
case 'TaxTotal':
return round(round($this->tax1, 2) + round($this->tax2, 2) + round($this->tax3, 2) + round($this->tax4, 2) + round($this->tax5, 2), 2);
case 'tax_code':
if (isset($this->taxCode->code)) {
return $this->taxCode->code;
} else {
return '';
}
case 'payment':
if (isset($this->payment)) {
return parent::__get($strName);
} else {
return new CartPayment();
}
case 'Taxes':
$arrTaxes = Tax::model()->findAll(array('order' => 'id'));
return array($arrTaxes[0]->tax => round($this->tax1, 2), $arrTaxes[1]->tax => round($this->tax2, 2), $arrTaxes[2]->tax => round($this->tax3, 2), $arrTaxes[3]->tax => round($this->tax4, 2), $arrTaxes[4]->tax => round($this->tax5, 2));
case 'Pending':
return $this->GetPending();
case 'shipping_sell':
if (isset($this->shipping->shipping_sell)) {
return $this->shipping->getShippingSell();
} else {
return 0;
}
default:
return parent::__get($strName);
}
}
示例4: LoadByLS
public static function LoadByLS($intId)
{
return Tax::model()->findByAttributes(array('lsid' => $intId));
}
示例5: list_taxes
/**
* Tax List
*
* @param string $passkey
* @return string
* @throws SoapFault
* @soap
*/
public function list_taxes($passkey)
{
self::check_passkey($passkey);
$obj = Tax::model()->findAll();
return CJSON::encode($obj);
}