Commit c198e70a1f5bc3397b48b7f4d82746f78cb5f994
Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
src/app/backend/controllers/DiscountController.php
... | ... | @@ -222,6 +222,8 @@ class DiscountController extends Controller |
222 | 222 | |
223 | 223 | $status = $this->models->getDiscount()->getStatus($id); |
224 | 224 | |
225 | + empty($status) ? $status = $status[0] : $status = 'Cann\'t get status'; | |
226 | + | |
225 | 227 | if ($status == 1) { |
226 | 228 | |
227 | 229 | $this->models->getDiscount()->updateStatus('0', $id); |
... | ... | @@ -232,6 +234,11 @@ class DiscountController extends Controller |
232 | 234 | $this->models->getDiscount()->updateStatus('1', $id); |
233 | 235 | |
234 | 236 | } |
237 | + else { | |
238 | + | |
239 | + $this->flash->error($status); | |
240 | + | |
241 | + } | |
235 | 242 | |
236 | 243 | return $this->response->redirect([ 'for' => 'discount_index' ]); |
237 | 244 | ... | ... |