當前位置: 首頁>>代碼示例>>PHP>>正文


PHP General::model方法代碼示例

本文整理匯總了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));
 }
開發者ID:TheTypoMaster,項目名稱:myapps,代碼行數:13,代碼來源:BalanceController.php

示例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'];
開發者ID:TheTypoMaster,項目名稱:myapps,代碼行數:31,代碼來源:backup+utk+Income+Statement.php

示例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);
     }
 }
開發者ID:TheTypoMaster,項目名稱:myapps,代碼行數:14,代碼來源:GeneralController.php


注:本文中的General::model方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。