Authored by Rock Zhang

修复限购商品分享页的显示问题

... ... @@ -902,15 +902,14 @@ class Helpers
* @param array &$array 需要排序的数组
* @param string $field 字段名称
* @param boolean $desc 是否降序排列,默认为false
* @param int $sortType 排序方式
*/
public static function sortArrByField(&$array, $field, $desc = false, $sortType = SORT_REGULAR)
public static function sortArrByField(&$array, $field, $desc = false)
{
$fieldArr = array();
foreach ($array as $k => $v) {
$fieldArr[$k] = isset($v[$field]) ? $v[$field] : '';
}
$sort = $desc == false ? SORT_ASC : SORT_DESC;
array_multisort($fieldArr, $sort, $array, $sortType);
array_multisort($fieldArr, $sort, $array);
}
}
... ...
... ... @@ -783,7 +783,7 @@ class DetailModel
}
if(count($result['attaches']) > 1) {
Helpers::sortArrByField($result['attaches'], 'orderBy', true, SORT_NUMERIC);
Helpers::sortArrByField($result['attaches'], 'orderBy');
}
} while (false);
... ... @@ -806,22 +806,22 @@ class DetailModel
$result['img'] = array(
'attachUrl' => Helpers::getImageUrl($attachment['attachUrl'], 750, ''),
'attachName' => $attachment['attachName'],
'intro' => $attachment['intro'],
'orderBy' => $attachment['orderBy']
'intro' => $attachment['intro']
);
$result['orderBy'] = $attachment['orderBy'];
break;
case 2: // 视频
$result['video'] = array(
'attachUrl' => $attachment['attachUrl'],
'orderBy' => $attachment['orderBy'],
'img' => Helpers::getImageUrl($attachment['intro'], 750, '')
);
$result['orderBy'] = $attachment['orderBy'];
break;
case 3: // 文本类型
$result['text'] = array(
'intro' => $attachment['intro'],
'orderBy' => $attachment['orderBy']
'intro' => $attachment['intro']
);
$result['orderBy'] = $attachment['orderBy'];
break;
default:
break;
... ...