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

This commit is contained in:
吴昊天 2022-08-26 09:56:09 +08:00
parent db2116f3d3
commit eebc637bea

View File

@ -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']);