Browse Source

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

吴昊天 3 years ago
parent
commit
eebc637bea
1 changed files with 4 additions and 0 deletions
  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']);