本文整理汇总了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);
}
示例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;
}