public function onFilterNewsByCategory() { $id = input('id'); $categoryName = input('category'); if($id == 0) { $categoryName = null; } //获取相关资讯 $filterData = ApiRepository::getPolicyNew($categoryName); if($filterData && !empty($filterData['data'])) { foreach ($filterData['data'] as &$item) { $item['type'] = 'policy'; } } $partialName = 'indexlist/index'; return [ '#tab-content-list ul' => $this->makePartial($partialName,[ 'data' => $filterData, 'category' => 4, 'categoryName' => $categoryName, ]) ]; }
后端代码如上,这是一个筛选功能,之前的是单选,现在需改为多选。虽然已实现多点击,但每次只能提交最后一次点击的选项。
破晓之盾