diff --git a/controllers/OrderController.php b/controllers/OrderController.php index 29a4ddf..343e24b 100755 --- a/controllers/OrderController.php +++ b/controllers/OrderController.php @@ -9,6 +9,7 @@ use artbox\order\labels\models\Label; use artbox\order\models\OrderProduct; use artbox\order\labels\models\Payment; + use backend\components\Incust; use Yii; use artbox\order\models\Order; use yii\web\Controller; @@ -217,10 +218,7 @@ public function actionUpdate($id) { $model = $this->findModel($id); - /** - * @var \backend\components\Incust $incust; - */ - $incust = \Yii::$app->get('incust'); + if ($model->load(Yii::$app->request->post()) && $model->save() && !empty( \Yii::$app->request->post( @@ -229,7 +227,11 @@ )) { //print_r(\Yii::$app->request->post('OrderProduct')); die(); OrderProduct::saveItems(\Yii::$app->request->post('OrderProduct'), $id); - if ($model->paid) { + if ($model->paid and class_exists(Incust::className())) { + /** + * @var \backend\components\Incust $incust; + */ + $incust = \Yii::$app->get('incust'); $check = $incust->generateCheck($model); $data = $incust->processCheck($check); if (is_array($data) and !empty($data)) { -- libgit2 0.21.4