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


PHP Price::model方法代碼示例

本文整理匯總了PHP中Price::model方法的典型用法代碼示例。如果您正苦於以下問題:PHP Price::model方法的具體用法?PHP Price::model怎麽用?PHP Price::model使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Price的用法示例。


在下文中一共展示了Price::model方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionSaveInfo

 public function actionSaveInfo()
 {
     $a = 1000000000;
     if ($_POST['basic_neicang1'] != NULL && $a > (int) $_POST['basic_neicang1']) {
         $a = (int) $_POST['basic_neicang1'];
     }
     if ($_POST['classic_neicang1'] != NULL && $a > (int) $_POST['classic_neicang1']) {
         $a = (int) $_POST['classic_neicang1'];
     }
     if ($_POST['basic_haijing1'] != NULL && $a > (int) $_POST['basic_haijing1']) {
         $a = (int) $_POST['basic_haijing1'];
     }
     if ($_POST['classic_haijing1'] != NULL && $a > (int) $_POST['basic_haijing1']) {
         $a = (int) $_POST['classic_haijing1'];
     }
     if ($_POST['basic_yangtai1'] != NULL && $a > (int) $_POST['basic_yangtai1']) {
         $a = (int) $_POST['basic_yangtai1'];
     }
     if ($_POST['classic_yangtai1'] != NULL && $a > (int) $_POST['classic_yangtai1']) {
         $a = (int) $_POST['classic_yangtai1'];
     }
     if ($_POST['basic_taofang1'] != NULL && $a > (int) $_POST['basic_taofang1']) {
         $a = (int) $_POST['basic_taofang1'];
     }
     if ($_POST['classic_taofang1'] != NULL && $a > (int) $_POST['classic_taofang1']) {
         $a = (int) $_POST['classic_taofang1'];
     }
     $a1 = $_POST['basic_neicang1'] . ',' . $_POST['basic_neicang2'] . ',' . $_POST['basic_neicang3'];
     $a2 = $_POST['classic_neicang1'] . ',' . $_POST['classic_neicang2'] . ',' . $_POST['classic_neicang3'];
     $b1 = $_POST['basic_haijing1'] . ',' . $_POST['basic_haijing2'] . ',' . $_POST['basic_haijing3'];
     $b2 = $_POST['classic_haijing1'] . ',' . $_POST['classic_haijing2'] . ',' . $_POST['classic_haijing3'];
     $c1 = $_POST['basic_yangtai1'] . ',' . $_POST['basic_yangtai2'] . ',' . $_POST['basic_yangtai3'];
     $c2 = $_POST['classic_yangtai1'] . ',' . $_POST['classic_yangtai2'] . ',' . $_POST['classic_yangtai3'];
     $d1 = $_POST['basic_taofang1'] . ',' . $_POST['basic_taofang2'] . ',' . $_POST['basic_taofang3'];
     $d2 = $_POST['classic_taofang1'] . ',' . $_POST['classic_taofang2'] . ',' . $_POST['classic_taofang3'];
     $var = explode(',', $_POST['id']);
     $id = $var[0];
     $route_id = $var[1];
     //		echo $route_id;
     //		echo $a;
     if ($a != 1000000000) {
         Route::model()->updateByPk($route_id, array('price' => $a));
     }
     Price::model()->updateByPk($id, array('basic_neicang' => $a1, 'classic_neicang' => $a2, 'basic_haijing' => $b1, 'classic_haijing' => $b2, 'basic_yangtai' => $c1, 'classic_yangtai' => $c2, 'basic_taofang' => $d1, 'classic_taofang' => $d2));
     $this->redirect(Yii::app()->request->urlReferrer);
 }
開發者ID:rocketyang,項目名稱:yii2,代碼行數:46,代碼來源:PriceController.php

示例2: 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 = Price::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
開發者ID:ASDAFF,項目名稱:its-crm,代碼行數:13,代碼來源:PriceController.php


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