Commit 105e64fb873d05822357b4acbccc61ce9f1f6fba
1 parent
f2217302
empty check
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
src/app/frontend/controllers/PageController.php
| ... | ... | @@ -144,7 +144,7 @@ |
| 144 | 144 | //discount |
| 145 | 145 | $discount = $this->models->getDiscount()->getActiveData(); |
| 146 | 146 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 147 | - $discount = $discount[0]; | |
| 147 | + $discount = empty($discount[0])? 0 : $discount[0]; | |
| 148 | 148 | //vip |
| 149 | 149 | $users_group_id = $this->session->get('users_group_id'); |
| 150 | 150 | |
| ... | ... | @@ -442,7 +442,7 @@ |
| 442 | 442 | //discount |
| 443 | 443 | $discount = $this->models->getDiscount()->getActiveData(); |
| 444 | 444 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 445 | - $discount = $discount[0]; | |
| 445 | + $discount = empty($discount[0])? 0 : $discount[0]; | |
| 446 | 446 | //vip |
| 447 | 447 | $users_group_id = $this->session->get('users_group_id'); |
| 448 | 448 | |
| ... | ... | @@ -712,7 +712,7 @@ |
| 712 | 712 | //discount |
| 713 | 713 | $discount = $this->models->getDiscount()->getActiveData(); |
| 714 | 714 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 715 | - $discount = $discount[0]; | |
| 715 | + $discount = empty($discount[0])? 0 : $discount[0];$discount = $discount[0]; | |
| 716 | 716 | //vip |
| 717 | 717 | $users_group_id = $this->session->get('users_group_id'); |
| 718 | 718 | |
| ... | ... | @@ -928,7 +928,7 @@ |
| 928 | 928 | //discount |
| 929 | 929 | $discount = $this->models->getDiscount()->getActiveData(); |
| 930 | 930 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 931 | - $discount = $discount[0]; | |
| 931 | + $discount = empty($discount[0])? 0 : $discount[0]; | |
| 932 | 932 | //vip |
| 933 | 933 | $users_group_id = $this->session->get('users_group_id'); |
| 934 | 934 | |
| ... | ... | @@ -1356,7 +1356,7 @@ |
| 1356 | 1356 | //discount |
| 1357 | 1357 | $discount = $this->models->getDiscount()->getActiveData(); |
| 1358 | 1358 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 1359 | - $discount = $discount[0]; | |
| 1359 | + $discount = empty($discount[0])? 0 : $discount[0]; | |
| 1360 | 1360 | foreach ($groups_ as &$item) { |
| 1361 | 1361 | if ($discount['discount'] > 0 && $discount['discount'] <= 100 && in_array($item['id'], $discount['group_ids'])) { |
| 1362 | 1362 | $item['discounted_price'] = round($item['price']*(1-$discount['discount']/100), 1); |
| ... | ... | @@ -1433,7 +1433,7 @@ |
| 1433 | 1433 | //discount |
| 1434 | 1434 | $discount = $this->models->getDiscount()->getActiveData(); |
| 1435 | 1435 | $discount = $this->models->getDiscount()->explodeGroupIds($discount); |
| 1436 | - $discount = $discount[0]; | |
| 1436 | + $discount = empty($discount[0])? 0 : $discount[0]; | |
| 1437 | 1437 | |
| 1438 | 1438 | $this->view->setVars([ |
| 1439 | 1439 | 'groups' => $items, | ... | ... |