Преглед на файлове

【程序目录】商品列表页面增加ids参数数据验证

吴昊天 преди 3 години
родител
ревизия
eebc637bea
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      crmeb/app/api/controller/v1/store/StoreProductController.php

+ 4 - 0
crmeb/app/api/controller/v1/store/StoreProductController.php

@@ -66,6 +66,10 @@ class StoreProductController
         }
         if ($where['ids'] && is_string($where['ids'])) {
             $where['ids'] = explode(',', $where['ids']);
+            foreach ($where['ids'] as $key => &$item) {
+                $where['ids'][$key] = (int)$item;
+                if ($where['ids'][$key] == 0) unset($where['ids'][$key]);
+            }
         }
         if (!$where['ids']) {
             unset($where['ids']);