Commit d5e063f5fa97fb55c570602619891e6dc6519baa
1 parent
e715ad66
core order incust
Showing
1 changed file
with
7 additions
and
5 deletions
Show diff stats
controllers/OrderController.php
@@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
9 | use artbox\order\labels\models\Label; | 9 | use artbox\order\labels\models\Label; |
10 | use artbox\order\models\OrderProduct; | 10 | use artbox\order\models\OrderProduct; |
11 | use artbox\order\labels\models\Payment; | 11 | use artbox\order\labels\models\Payment; |
12 | + use backend\components\Incust; | ||
12 | use Yii; | 13 | use Yii; |
13 | use artbox\order\models\Order; | 14 | use artbox\order\models\Order; |
14 | use yii\web\Controller; | 15 | use yii\web\Controller; |
@@ -217,10 +218,7 @@ | @@ -217,10 +218,7 @@ | ||
217 | public function actionUpdate($id) | 218 | public function actionUpdate($id) |
218 | { | 219 | { |
219 | $model = $this->findModel($id); | 220 | $model = $this->findModel($id); |
220 | - /** | ||
221 | - * @var \backend\components\Incust $incust; | ||
222 | - */ | ||
223 | - $incust = \Yii::$app->get('incust'); | 221 | + |
224 | 222 | ||
225 | if ($model->load(Yii::$app->request->post()) && $model->save() && !empty( | 223 | if ($model->load(Yii::$app->request->post()) && $model->save() && !empty( |
226 | \Yii::$app->request->post( | 224 | \Yii::$app->request->post( |
@@ -229,7 +227,11 @@ | @@ -229,7 +227,11 @@ | ||
229 | )) { | 227 | )) { |
230 | //print_r(\Yii::$app->request->post('OrderProduct')); die(); | 228 | //print_r(\Yii::$app->request->post('OrderProduct')); die(); |
231 | OrderProduct::saveItems(\Yii::$app->request->post('OrderProduct'), $id); | 229 | OrderProduct::saveItems(\Yii::$app->request->post('OrderProduct'), $id); |
232 | - if ($model->paid) { | 230 | + if ($model->paid and class_exists(Incust::className())) { |
231 | + /** | ||
232 | + * @var \backend\components\Incust $incust; | ||
233 | + */ | ||
234 | + $incust = \Yii::$app->get('incust'); | ||
233 | $check = $incust->generateCheck($model); | 235 | $check = $incust->generateCheck($model); |
234 | $data = $incust->processCheck($check); | 236 | $data = $incust->processCheck($check); |
235 | if (is_array($data) and !empty($data)) { | 237 | if (is_array($data) and !empty($data)) { |