当前位置: 首页>>代码示例>>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;未经允许,请勿转载。