本文整理汇总了PHP中General::model方法的典型用法代码示例。如果您正苦于以下问题:PHP General::model方法的具体用法?PHP General::model怎么用?PHP General::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General::model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
$message = General::model()->findbyPk(1);
$this->message = $message->year_1;
$this->message2 = $message->pro_1;
$this->message3 = $message->intangible_1;
$this->message4 = $message->development_1;
$this->message5 = $message->invest_sub_1;
$this->message6 = $message->invest_aso_1;
$this->message7 = $message->other_1;
$this->message8 = $message->total_1;
$this->render('index', array('year_1' => $this->message));
}
示例2: array
<?php
echo $this->renderPartial('_balanceSheet', array('model' => $model));
?>
<?php
if (isset($_GET['General'])) {
if (isset($_GET['General']['year']) and $_GET['General']['year'] == 'all') {
$data = General::model()->findAll('company_id=:company_id ORDER BY year', array(':company_id' => $_GET['General']['company_id']));
} else {
$data = General::model()->findByAttributes(array('company_id' => $_GET['General']['company_id'], 'year' => $_GET['General']['year']));
}
if (!empty($data)) {
$year = array();
$company_name = $company_id = '';
if (is_array($data)) {
foreach ($data as $key => $value) {
if (!$company_name) {
$company_name = $value['company_name'];
}
if (!$company_id) {
$company_id = $value['company_id'];
}
$revenue[$value['year']] = $value['revenue'];
$otherOperatingIncome[$value['year']] = $value['otherOperatingIncome'];
$directOperatingExpenses[$value['year']] = $value['directOperatingExpenses'];
$administrationExpenses[$value['year']] = $value['administrationExpenses'];
$otherOperatingExpenses[$value['year']] = $value['otherOperatingExpenses'];
$lossProfitFromOperations[$value['year']] = $value['lossProfitFromOperations'];
$financeCost[$value['year']] = $value['financeCost'];
$sharedOfLossprofit[$value['year']] = $value['sharedOfLossprofit'];
示例3: actionYears
public function actionYears()
{
$data = General::model()->findAll('company_id=:company_id ORDER BY year', array(':company_id' => $_POST['General']['company_id']));
$data = CHtml::listData($data, 'year', 'year');
if ($_POST['General']['company_id']) {
echo CHtml::tag('option', array('value' => ''), CHtml::encode('Please Choose'), true);
echo CHtml::tag('option', array('value' => 'all'), CHtml::encode('All'), true);
foreach ($data as $key => $value) {
echo CHtml::tag("option", array('value' => $key), CHtml::encode($value), true);
}
} else {
echo CHtml::tag('option', array('value' => ''), CHtml::encode('Choose Company First'), true);
}
}