Commit 3feb65592e5e18dcf6ca8952576880dfef1904e6
Merge branch 'discount' of gitlab.artweb.com.ua:Alex/semena
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
src/app/backend/controllers/DiscountController.php
... | ... | @@ -222,8 +222,6 @@ class DiscountController extends Controller |
222 | 222 | |
223 | 223 | $status = $this->models->getDiscount()->getStatus($id); |
224 | 224 | |
225 | - isset($status) ? $status = $status[0] : $status = 'Cann\'t get status'; | |
226 | - | |
227 | 225 | if ($status == 1) { |
228 | 226 | |
229 | 227 | $this->models->getDiscount()->updateStatus('0', $id); |
... | ... | @@ -236,7 +234,7 @@ class DiscountController extends Controller |
236 | 234 | } |
237 | 235 | else { |
238 | 236 | |
239 | - $this->flash->error($status); | |
237 | + $this->flash->error(var_dump($status)); | |
240 | 238 | |
241 | 239 | } |
242 | 240 | ... | ... |
src/lib/models/discount.php
... | ... | @@ -60,7 +60,7 @@ class discount extends \db |
60 | 60 | */ |
61 | 61 | public function getStatus($id) { |
62 | 62 | |
63 | - return $this->get( | |
63 | + $status = $this->get( | |
64 | 64 | ' |
65 | 65 | SELECT status |
66 | 66 | FROM public.discount |
... | ... | @@ -73,6 +73,8 @@ class discount extends \db |
73 | 73 | -1 |
74 | 74 | ); |
75 | 75 | |
76 | + return $status[0]['status']; | |
77 | + | |
76 | 78 | } |
77 | 79 | |
78 | 80 | ... | ... |