Authored by Rock Zhang

添加对不存在二级品类的数据进行验证的逻辑

Code Review By Rock Zhang
... ... @@ -126,6 +126,10 @@ class ClassModel
foreach ($data as $item) {
$id = $item['category_id'];
$result['first'][$id] = $item['category_name'];
if (!isset($item['sub'])) {
continue;
}
foreach ($item['sub'] as $sub) {
$id = $sub['category_id'];
$result['second'][$id] = $sub['category_name'];
... ...