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 | 9 | use artbox\order\labels\models\Label; |
10 | 10 | use artbox\order\models\OrderProduct; |
11 | 11 | use artbox\order\labels\models\Payment; |
12 | + use backend\components\Incust; | |
12 | 13 | use Yii; |
13 | 14 | use artbox\order\models\Order; |
14 | 15 | use yii\web\Controller; |
... | ... | @@ -217,10 +218,7 @@ |
217 | 218 | public function actionUpdate($id) |
218 | 219 | { |
219 | 220 | $model = $this->findModel($id); |
220 | - /** | |
221 | - * @var \backend\components\Incust $incust; | |
222 | - */ | |
223 | - $incust = \Yii::$app->get('incust'); | |
221 | + | |
224 | 222 | |
225 | 223 | if ($model->load(Yii::$app->request->post()) && $model->save() && !empty( |
226 | 224 | \Yii::$app->request->post( |
... | ... | @@ -229,7 +227,11 @@ |
229 | 227 | )) { |
230 | 228 | //print_r(\Yii::$app->request->post('OrderProduct')); die(); |
231 | 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 | 235 | $check = $incust->generateCheck($model); |
234 | 236 | $data = $incust->processCheck($check); |
235 | 237 | if (is_array($data) and !empty($data)) { | ... | ... |