...
|
...
|
@@ -868,13 +868,16 @@ class HouseAdmin extends Api |
|
|
array_multisort(array_column($list,'createtime'),SORT_ASC,$list);
|
|
|
// 业主头像
|
|
|
$user_model = new \app\api\model\User();
|
|
|
// 业主头像
|
|
|
$house_admin_model = new HouseAdminModel();
|
|
|
foreach ($list as &$v) {
|
|
|
if($v['type'] == 1) {
|
|
|
$user = $user_model->field('id,nickname,avatar')->where('id',$v['user_id'])->find();
|
|
|
}else{
|
|
|
$user = HouseAdminModel::where(['user_id'=>$this->auth->id,'house_id'=>$msg['object_id']])->field('id,nickname,avatar')->find();
|
|
|
// 多管理员
|
|
|
if(!$user){
|
|
|
$house = House::get($msg['object_id']);
|
|
|
$user = HouseAdminModel::where(['id'=>$house['admin_user_id'],'user_id'=>$this->auth->id])->field('id,nickname,avatar')->find();
|
|
|
}
|
|
|
}
|
|
|
$user['avatar'] = cdnurl($user['avatar'],true);
|
|
|
$v['user'] = $user;
|
...
|
...
|
|