Commit 96164233 by 冷斌

族员审核列表

parent 50c1e10b
...@@ -38,8 +38,8 @@ class Model_User extends PhalApi_Model_NotORM ...@@ -38,8 +38,8 @@ class Model_User extends PhalApi_Model_NotORM
} }
$info['anchor_certification'] = $anchor_certification; $info['anchor_certification'] = $anchor_certification;
list($type, $familyId) = $this->getFamilyRole($uid);
$info['family_type'] = $this->getFamilyRole($uid); $info['family_type'] = $type;
} }
return $info; return $info;
...@@ -47,16 +47,19 @@ class Model_User extends PhalApi_Model_NotORM ...@@ -47,16 +47,19 @@ class Model_User extends PhalApi_Model_NotORM
protected function getFamilyRole($uid) protected function getFamilyRole($uid)
{ {
$type=0; $id = $type=0;
$familyinfo=DI()->notorm->family->where("uid=".$uid)->fetchOne(); $familyinfo=DI()->notorm->family->where("uid=".$uid)->fetchOne();
$user_family=DI()->notorm->users_family->where("uid=".$uid)->fetchOne(); $user_family=DI()->notorm->users_family->where("uid=".$uid)->fetchOne();
if (!empty($familyinfo)) { if (!empty($familyinfo)) {
$type = 1; $type = 1;
$id = $familyinfo['id'];
} }
if (!empty($user_family)) { if (!empty($user_family)) {
$type = $user_family['role'] ? 2 : 3; $type = $user_family['role'] ? 2 : 3;
$id = $user_family['familyid'];
} }
return $type;
return [$type,$id ];
} }
/* 判断昵称是否重复 */ /* 判断昵称是否重复 */
...@@ -982,10 +985,25 @@ class Model_User extends PhalApi_Model_NotORM ...@@ -982,10 +985,25 @@ class Model_User extends PhalApi_Model_NotORM
public function familyAuthList($uid) public function familyAuthList($uid)
{ {
$role = $this->getFamilyRole($uid); list($role, $familyId) = $this->getFamilyRole($uid);
if (in_array($role, [0, 3])) { if (in_array($role, [0, 3])) {
return $role; return $role;
} }
$list=DI()->notorm->users_family->select('id, uid')->where("familyid={$familyId} and state=0")->fetchAll();
foreach($list as $k=>$v){
$userinfo=getUserInfo($v['uid']);
$v['user_nicename']=$userinfo['user_nicename'];
$v['avatar']=$userinfo['avatar'];
$v['avatar_thumb']=$userinfo['avatar_thumb'];
$v['sex']=$userinfo['sex'];
$v['level']=$userinfo['level'];
$v['level_anchor'] = $userinfo['level_anchor'];
$list[$k]=$v;
}
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