where('mer_id', $mer_id); $model = $model->whereIn('uid', [$where['uid'], $where['to_uid']]); $model = $model->whereIn('to_uid', [$where['uid'], $where['to_uid']]); $model->order("add_time desc"); return self::page($model,function($item) use ($mer_id){ $user = StoreService::field("nickname,avatar")->where('mer_id',$mer_id)->where(array("uid"=>$item["uid"]))->find(); if(!$user)$user = User::field("nickname,avatar")->where(array("uid"=>$item["uid"]))->find(); $item["nickname"] = $user["nickname"]; $item["avatar"] = $user["avatar"]; }, $where); } }