Commit 509bd5b5 authored by liuyuzhen's avatar liuyuzhen

推荐店铺排序问题

parent 747a218b
......@@ -866,11 +866,23 @@ class StoreServiceModel extends \Business\AbstractModel{
$returnStores['stores'][] =$purchasedStore;
}
}
if($returnStores['stores']){
foreach($returnStores['stores'] as $key => $tempStore){
$tempDistance[$key] = $tempStore['storeDistance'];
}
array_multisort($tempDistance, SORT_ASC, $returnStores['stores']);
$return[] = $returnStores;
}
}
if($return){
$tempReturn = array();
foreach($return as $tempVal){
$distance = min(array_column($tempVal['stores'],'storeDistance'));
$tempReturn[$distance] = $tempVal;
}
ksort($tempReturn);
$return = array_values($tempReturn);
return $return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment