Commit f992445ad4b5471c4b75ff91141eff2ea128021e
1 parent
9f4ca888
products pick
Showing
2 changed files
with
5 additions
and
11 deletions
Show diff stats
src/app/backend/controllers/DiscountController.php
| ... | ... | @@ -170,9 +170,9 @@ class DiscountController extends Controller |
| 170 | 170 | $data[0]['end_date'] = $this->request->getPost('end_date'); |
| 171 | 171 | $data[0]['description'] = $this->request->getPost('description'); |
| 172 | 172 | |
| 173 | - $data[0]['catalog_ids'] = $this->request->getPost('catalog', 'string', NULL ); | |
| 173 | + //$data[0]['catalog_ids'] = $this->request->getPost('catalog', 'string', NULL ); | |
| 174 | 174 | $data[0]['group_ids'] = $this->request->getPost('items', 'string', NULL ); |
| 175 | - $data[0]['all_items'] = $this->request->getPost('all_items', 'int', NULL); | |
| 175 | + //$data[0]['all_items'] = $this->request->getPost('all_items', 'int', NULL); | |
| 176 | 176 | |
| 177 | 177 | if ($data[0]['discount'] > 100) { |
| 178 | 178 | |
| ... | ... | @@ -217,14 +217,6 @@ class DiscountController extends Controller |
| 217 | 217 | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - foreach($data as $k => $i) { | |
| 221 | - | |
| 222 | - if(isset($i['image']) && !empty($i['image'])) | |
| 223 | - $data[$k]['image'] = $this->storage->getPhotoURL($i['image'], 'promo_codes', 'original'); | |
| 224 | - | |
| 225 | - } | |
| 226 | - | |
| 227 | - | |
| 228 | 220 | $this->view->pick( 'discount/addEdit' ); |
| 229 | 221 | |
| 230 | 222 | $this->view->setVars([ | ... | ... |
src/lib/models/discount.php
| ... | ... | @@ -192,7 +192,8 @@ class discount extends \db |
| 192 | 192 | description = :description, |
| 193 | 193 | start_date = :start_date, |
| 194 | 194 | end_date = :end_date, |
| 195 | - status = :status | |
| 195 | + status = :status, | |
| 196 | + group_ids = :group_ids | |
| 196 | 197 | WHERE |
| 197 | 198 | id = :id |
| 198 | 199 | ', |
| ... | ... | @@ -203,6 +204,7 @@ class discount extends \db |
| 203 | 204 | 'start_date' => $data['start_date'], |
| 204 | 205 | 'end_date' => $data['end_date'], |
| 205 | 206 | 'status' => $data['status'], |
| 207 | + 'group_ids' => $data['group_ids'], | |
| 206 | 208 | 'id' => $id |
| 207 | 209 | ] |
| 208 | 210 | ); | ... | ... |