Commit c256134f by 冷斌

update

parent 6a999250
...@@ -1381,24 +1381,25 @@ class Api_User extends PhalApi_Api { ...@@ -1381,24 +1381,25 @@ class Api_User extends PhalApi_Api {
// $labels=array_slice($label,0,3); // $labels=array_slice($label,0,3);
if ($uid == $touid) { if ($uid == $touid) {
$labelIds = $domain->getUserLabel(0,$touid); $labelItems = $domain->getUserLabel(0,$touid);
$labelId = []; $labelId = [];
foreach ($labelIds as $item) { foreach ($labelItems as $item) {
$labelId = array_merge($labelId, array_filter(preg_split('/,|,/',$item['label']))); $labelId = array_merge($labelId, array_filter(preg_split('/,|,/',$item['label'])));
} }
$ids = array_count_values($labelId); $ids = array_count_values($labelId);
arsort($ids); arsort($ids);
var_dump($ids); for ($i=0; $i <= 2; $i++ ) {
die; if (is_array($ids)) {
$labelIds[] = array_shift($ids);
} else {
$labelIds[] = 0;
}
}
} else { } else {
$labelIds = $domain->getUserLabel($uid,$touid); $labelIds = $domain->getUserLabel($uid,$touid);
$labelIds=preg_split('/,|,/',$labelIds['label']); $labelIds=preg_split('/,|,/',$labelIds['label']);
} }
$l = []; $l = [];
foreach ($labels as $label) { foreach ($labels as $label) {
if (in_array($label['id'], $labelIds)) { if (in_array($label['id'], $labelIds)) {
$l[] = $label; $l[] = $label;
......
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