Showing
1 changed file
with
6 additions
and
6 deletions
@@ -62,6 +62,7 @@ class ListProcess | @@ -62,6 +62,7 @@ class ListProcess | ||
62 | $filters = array('classify' => array()); | 62 | $filters = array('classify' => array()); |
63 | 63 | ||
64 | // tar modified 1606151500 返回数据中没有gender时要添加gender | 64 | // tar modified 1606151500 返回数据中没有gender时要添加gender |
65 | + if (empty($data['gender'])) { | ||
65 | switch ($gender) { | 66 | switch ($gender) { |
66 | case '1,3': | 67 | case '1,3': |
67 | $data['gender'] = array('1,3' => 'BOYS'); | 68 | $data['gender'] = array('1,3' => 'BOYS'); |
@@ -73,6 +74,7 @@ class ListProcess | @@ -73,6 +74,7 @@ class ListProcess | ||
73 | $data['gender'] = array('1,3' => 'BOYS', '2,3' => 'GIRLS'); | 74 | $data['gender'] = array('1,3' => 'BOYS', '2,3' => 'GIRLS'); |
74 | break; | 75 | break; |
75 | } | 76 | } |
77 | + } | ||
76 | 78 | ||
77 | $num = 1; | 79 | $num = 1; |
78 | foreach ($data as $key => $val) { | 80 | foreach ($data as $key => $val) { |
@@ -221,18 +223,16 @@ class ListProcess | @@ -221,18 +223,16 @@ class ListProcess | ||
221 | ) | 223 | ) |
222 | ); | 224 | ); |
223 | 225 | ||
224 | - // tar add 1606151500 处理性别参数 | ||
225 | - switch ($gender) { | 226 | + foreach ($data as $key => $value) { |
227 | + switch ($key) { | ||
226 | case '1,3': | 228 | case '1,3': |
227 | - array_push($result['subs'], array('dataId' => '1,3', 'name' => 'BOYS')); | ||
228 | - break; | ||
229 | case '2,3': | 229 | case '2,3': |
230 | - array_push($result['subs'], array('dataId' => '2,3', 'name' => 'GIRLS')); | 230 | + array_push($result['subs'], array('dataId' => $key, 'name' => $value)); |
231 | break; | 231 | break; |
232 | default: | 232 | default: |
233 | - array_push($result['subs'], array('dataId' => '1,3', 'name' => 'BOYS'), array('dataId' => '2,3', 'name' => 'GIRLS')); | ||
234 | break; | 233 | break; |
235 | } | 234 | } |
235 | + } | ||
236 | 236 | ||
237 | // 处理选中状态 | 237 | // 处理选中状态 |
238 | foreach ($result['subs'] as &$val) { | 238 | foreach ($result['subs'] as &$val) { |
-
Please register or login to post a comment