store\controllers\OrderController::actionShip PHP Method

actionShip() public method

public actionShip ( $id )
    public function actionShip($id)
    {
        $model = Order::findOne(['id' => $id, 'store_id' => Yii::$app->user->identity->store_id]);
        if (!$model) {
            throw new NotFoundHttpException('未找到该订单!');
        }
        if ($model->ship()) {
            Yii::$app->session->setFlash('success', '设置配送成功!');
        } else {
            Yii::$app->session->setFlash('danger', '配送请求失败!');
        }
        return $this->redirect(['view', 'id' => $id]);
    }