Commit 057471e0 by 冷斌

update

parent fdb44cd4
...@@ -1380,8 +1380,14 @@ class Api_User extends PhalApi_Api { ...@@ -1380,8 +1380,14 @@ class Api_User extends PhalApi_Api {
// $labels=array_slice($label,0,3); // $labels=array_slice($label,0,3);
$labelIds = $domain->getUserLabel($uid,$touid); if ($uid == $touid) {
$labelIds=preg_split('/,|,/',$labelIds['label']);
} else {
$labelIds = $domain->getUserLabel($uid,$touid);
$labelIds=preg_split('/,|,/',$labelIds['label']);
}
$l = []; $l = [];
......
...@@ -203,7 +203,7 @@ class Domain_User { ...@@ -203,7 +203,7 @@ class Domain_User {
return $rs; return $rs;
} }
public function getUserLabel($uid,$touid) { public function getUserLabel($uid = 0,$touid = 0) {
$rs = array(); $rs = array();
$model = new Model_User(); $model = new Model_User();
......
...@@ -655,9 +655,17 @@ class Model_User extends PhalApi_Model_NotORM ...@@ -655,9 +655,17 @@ class Model_User extends PhalApi_Model_NotORM
} }
/* 用户标签 */ /* 用户标签 */
public function getUserLabel($uid, $touid) public function getUserLabel($uid = 0, $touid = 0)
{ {
$list = DI()->notorm->users_label->select("label")->where('uid=? and touid=?', $uid, $touid)->fetchOne(); $p = [];
if ($uid > 0){
$p['uid'] = $uid;
}
if ($touid > 0) {
$p['touid'] = $touid;
}
$list = DI()->notorm->users_label->select("label")->where($p)->fetchOne();
return $list; return $list;
......
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