Commit c256134f by 冷斌

update

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