...
|
...
|
@@ -56,9 +56,10 @@ class ListProcess |
|
|
* 处理筛选数据
|
|
|
*
|
|
|
* @param $data
|
|
|
* @param string | integer $gender 默认选择的性别,默认0表示所有
|
|
|
* @return array 处理之后的筛选数据
|
|
|
*/
|
|
|
public static function getFilterData($data)
|
|
|
public static function getFilterData($data, $gender = 0)
|
|
|
{
|
|
|
// 过滤条件数据
|
|
|
$filters = array('classify'=>array());
|
...
|
...
|
@@ -72,7 +73,7 @@ class ListProcess |
|
|
if (!is_callable("self::$key")) {
|
|
|
continue;
|
|
|
}
|
|
|
$build = self::$key($val);
|
|
|
$build = self::$key($val, $gender);
|
|
|
if($num === 1)
|
|
|
{
|
|
|
$build['active'] = true;
|
...
|
...
|
@@ -173,7 +174,7 @@ class ListProcess |
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
private static function gender($data)
|
|
|
private static function gender($data, $gender)
|
|
|
{
|
|
|
$result = array(
|
|
|
'title' => '性别',
|
...
|
...
|
@@ -182,8 +183,7 @@ class ListProcess |
|
|
'dataType' => 'gender',
|
|
|
'subs' => array(
|
|
|
array(
|
|
|
'chosed' => true,
|
|
|
'dataId' => 0,
|
|
|
'dataId' => '1,2,3',
|
|
|
'name' => '所有性别'
|
|
|
),
|
|
|
array(
|
...
|
...
|
@@ -197,6 +197,11 @@ class ListProcess |
|
|
)
|
|
|
);
|
|
|
|
|
|
// 处理选中状态
|
|
|
foreach ($result['subs'] as &$val) {
|
|
|
$val['dataId'] === $gender && $val['chosed'] = true;
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
|