Commit c97a48c7e7896d54a2d9c97e7e46e337de1ca967
1 parent
be1609ed
status
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,6 +222,8 @@ class DiscountController extends Controller | ||
222 | 222 | ||
223 | $status = $this->models->getDiscount()->getStatus($id); | 223 | $status = $this->models->getDiscount()->getStatus($id); |
224 | 224 | ||
225 | + empty($status) ? $status = $status[0] : $status = 'Cann\'t get status'; | ||
226 | + | ||
225 | if ($status == 1) { | 227 | if ($status == 1) { |
226 | 228 | ||
227 | $this->models->getDiscount()->updateStatus('0', $id); | 229 | $this->models->getDiscount()->updateStatus('0', $id); |
@@ -232,6 +234,11 @@ class DiscountController extends Controller | @@ -232,6 +234,11 @@ class DiscountController extends Controller | ||
232 | $this->models->getDiscount()->updateStatus('1', $id); | 234 | $this->models->getDiscount()->updateStatus('1', $id); |
233 | 235 | ||
234 | } | 236 | } |
237 | + else { | ||
238 | + | ||
239 | + $this->flash->error($status); | ||
240 | + | ||
241 | + } | ||
235 | 242 | ||
236 | return $this->response->redirect([ 'for' => 'discount_index' ]); | 243 | return $this->response->redirect([ 'for' => 'discount_index' ]); |
237 | 244 |