Commit 9ac2df32b5ba2d4549dbcafb6e89f791abcdd50b
1 parent
e6a3cbef
products pick
Showing
2 changed files
with
7 additions
and
4 deletions
Show diff stats
src/app/backend/controllers/DiscountController.php
@@ -84,9 +84,9 @@ class DiscountController extends Controller | @@ -84,9 +84,9 @@ class DiscountController extends Controller | ||
84 | $data['status'] = 1; | 84 | $data['status'] = 1; |
85 | 85 | ||
86 | 86 | ||
87 | - $data['catalog_ids'] = $this->request->getPost('catalog', 'string', NULL ); | 87 | + //$data['catalog_ids'] = $this->request->getPost('catalog', 'string', NULL ); |
88 | $data['group_ids'] = $this->request->getPost('items', 'string', NULL ); | 88 | $data['group_ids'] = $this->request->getPost('items', 'string', NULL ); |
89 | - $data['all_items'] = $this->request->getPost('all_items', 'int', NULL); | 89 | + //$data['all_items'] = $this->request->getPost('all_items', 'int', NULL); |
90 | 90 | ||
91 | if(!empty($data['group_ids']) && $this->models->getDiscount()->addData( $data )) { | 91 | if(!empty($data['group_ids']) && $this->models->getDiscount()->addData( $data )) { |
92 | 92 |
src/lib/models/discount.php
@@ -142,7 +142,8 @@ class discount extends \db | @@ -142,7 +142,8 @@ class discount extends \db | ||
142 | description, | 142 | description, |
143 | start_date, | 143 | start_date, |
144 | end_date, | 144 | end_date, |
145 | - status | 145 | + status, |
146 | + group_ids | ||
146 | ) | 147 | ) |
147 | VALUES | 148 | VALUES |
148 | ( | 149 | ( |
@@ -152,6 +153,7 @@ class discount extends \db | @@ -152,6 +153,7 @@ class discount extends \db | ||
152 | :start_date, | 153 | :start_date, |
153 | :end_date, | 154 | :end_date, |
154 | :status | 155 | :status |
156 | + :group_ids | ||
155 | ) | 157 | ) |
156 | RETURNING id | 158 | RETURNING id |
157 | ', | 159 | ', |
@@ -161,7 +163,8 @@ class discount extends \db | @@ -161,7 +163,8 @@ class discount extends \db | ||
161 | 'description' => $data['description'], | 163 | 'description' => $data['description'], |
162 | 'start_date' => $data['start_date'], | 164 | 'start_date' => $data['start_date'], |
163 | 'end_date' => $data['end_date'], | 165 | 'end_date' => $data['end_date'], |
164 | - 'status' => $data['status'] | 166 | + 'status' => $data['status'], |
167 | + 'group_ids' => $data['group_ids'] | ||
165 | ], | 168 | ], |
166 | -1 | 169 | -1 |
167 | ); | 170 | ); |