本文整理汇总了PHP中app\models\Order::getBuildFk方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getBuildFk方法的具体用法?PHP Order::getBuildFk怎么用?PHP Order::getBuildFk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Order
的用法示例。
在下文中一共展示了Order::getBuildFk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionCreate
/**
* Creates a new Order model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate($build_id)
{
$model = new Order();
$model->build_fk = $build_id;
$build = $model->getBuildFk()->one();
//$build2 = $this->findBuild($build_id);
$parts = new ActiveDataProvider(['query' => $build->getParts(), 'sort' => false]);
$address = $this->getAddress($build->user_fk);
//$model->build_fk = $build->build_guide_id;
$model->customer_fk = $build->user_fk;
$model->status_fk = Order::STAT_PENDING;
$model->date_of_order = date("Y-m-d H:i:s");
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->order_id]);
} else {
return $this->render('create', ['model' => $model, 'build' => $build, 'parts' => $parts, 'address' => $address]);
}
}