本文整理汇总了PHP中Commande::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Commande::save方法的具体用法?PHP Commande::save怎么用?PHP Commande::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Commande
的用法示例。
在下文中一共展示了Commande::save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Commande();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
if (isset($_POST['Commande'])) {
$model->attributes = $_POST['Commande'];
if ($model->save()) {
$this->redirect(array('view', 'id' => $model->comkey));
}
}
$this->render('create', array('model' => $model));
}
示例2: actionPaypalPayment
public function actionPaypalPayment()
{
$customer_model = new Customer();
$commande_model = new Commande();
$customer_model->attributes = Yii::app()->user->getState('Customer');
$commande_model->attributes = Yii::app()->user->getState('Commande');
if (sizeof($customer_model->search()->getData()) == 0) {
$customer_model->bilsignupip = CHttpRequest::getUserHostAddress();
$customer_model->save();
$commande_model->bilkey = $customer_model->bilkey;
$commande_model->comdebut = date("Y-m-d");
$commande_model->save();
} else {
$customerTemp = $customer_model->search()->getData();
$customer_model->bilkey = $customerTemp[0]->attributes['bilkey'];
}
if (isset($_POST['payment_status'])) {
if ($_POST['payment_status'] == "Completed" || $_POST['payment_status'] == "Pending") {
$city = Goodcity::model()->findByPk($_POST['item_number']);
$this->sendEmailConfirmation($customer_model, $city, $commande_model, $_POST['txn_id'], $this->getInvoiceTotals($customer_model, $commande_model));
$this->render('application/2-orderform', array('goodcity' => $city, 'thanks' => true, 'payment_type' => "paypal", 'payment_method' => "email", 'order_totals' => $this->getInvoiceTotals($customer_model, $commande_model), 'customer_model' => $customer_model, 'commande_model' => $commande_model, 'auth_code' => $_POST['txn_id']));
} else {
$this->redirect(array('user/order', 'transactionError' => true));
}
} else {
$city = Goodcity::model()->findByPk($commande_model['comgoodcitykey']);
$this->redirect(array('user/signup', 'city' => $commande_model['comgoodcitykey']));
}
}