Showing
1 changed file
with
21 additions
and
21 deletions
@@ -62,16 +62,18 @@ class ListProcess | @@ -62,16 +62,18 @@ 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 | - switch ($gender) { | ||
66 | - case '1,3': | ||
67 | - $data['gender'] = array('1,3' => 'BOYS'); | ||
68 | - break; | ||
69 | - case '2,3': | ||
70 | - $data['gender'] = array('2,3' => 'GIRLS'); | ||
71 | - break; | ||
72 | - default: | ||
73 | - $data['gender'] = array('1,3' => 'BOYS', '2,3' => 'GIRLS'); | ||
74 | - break; | 65 | + if (empty($data['gender'])) { |
66 | + switch ($gender) { | ||
67 | + case '1,3': | ||
68 | + $data['gender'] = array('1,3' => 'BOYS'); | ||
69 | + break; | ||
70 | + case '2,3': | ||
71 | + $data['gender'] = array('2,3' => 'GIRLS'); | ||
72 | + break; | ||
73 | + default: | ||
74 | + $data['gender'] = array('1,3' => 'BOYS', '2,3' => 'GIRLS'); | ||
75 | + break; | ||
76 | + } | ||
75 | } | 77 | } |
76 | 78 | ||
77 | $num = 1; | 79 | $num = 1; |
@@ -221,17 +223,15 @@ class ListProcess | @@ -221,17 +223,15 @@ class ListProcess | ||
221 | ) | 223 | ) |
222 | ); | 224 | ); |
223 | 225 | ||
224 | - // tar add 1606151500 处理性别参数 | ||
225 | - switch ($gender) { | ||
226 | - case '1,3': | ||
227 | - array_push($result['subs'], array('dataId' => '1,3', 'name' => 'BOYS')); | ||
228 | - break; | ||
229 | - case '2,3': | ||
230 | - array_push($result['subs'], array('dataId' => '2,3', 'name' => 'GIRLS')); | ||
231 | - break; | ||
232 | - default: | ||
233 | - array_push($result['subs'], array('dataId' => '1,3', 'name' => 'BOYS'), array('dataId' => '2,3', 'name' => 'GIRLS')); | ||
234 | - break; | 226 | + foreach ($data as $key => $value) { |
227 | + switch ($key) { | ||
228 | + case '1,3': | ||
229 | + case '2,3': | ||
230 | + array_push($result['subs'], array('dataId' => $key, 'name' => $value)); | ||
231 | + break; | ||
232 | + default: | ||
233 | + break; | ||
234 | + } | ||
235 | } | 235 | } |
236 | 236 | ||
237 | // 处理选中状态 | 237 | // 处理选中状态 |
-
Please register or login to post a comment