public function actionCustomer() { $model = new Order(); $errorMessage = null; if (isset($_GET['order_id']) && Order::model()->isValidateOrderId($_GET['order_id'])) { $model = $this->loadExistOrder($_GET['order_id']); $model->order_info = OrderState::model()->getStateZnByStateId($model->order_state_id) . $model->remark; $model->product_name = Product::model()->getProductNameByProductId($model->product_id); $model->order_photos = Photo::model()->findAllByAttributes(array('product_id' => $model->product_id)); } else { $model->unsetAttributes(); $errorMessage = Yii::t('order', 'Order is not exist!'); } $this->layout = false; $this->render('_customer', array('model' => $model, 'message' => $errorMessage)); }
public function actionSearch() { $model = new Order(); $errorMessage = null; if (isset($_GET['order_id']) && Order::model()->isValidateOrderId($_GET['order_id'])) { $model = $this->loadExistOrder($_GET['order_id']); $model->order_info = OrderState::model()->getStateZnByStateId($model->order_state_id) . $model->remark; //Open when the product model is finished //$model->product_name = Product::model()->getProductNameByProductId($model->product_id); } else { $model->unsetAttributes(); $errorMessage = '订单号不存在!'; } $this->layout = false; $this->render('_customer', array('model' => $model, 'message' => $errorMessage)); }