|
@@ -102,6 +102,46 @@ class Pub extends BaseController
|
|
|
}
|
|
|
return app('json')->success($data);
|
|
|
}
|
|
|
+
|
|
|
+ * 获取邀请人数排行榜
|
|
|
+ * @param Request $request
|
|
|
+ */
|
|
|
+ public function getInviteRankList(Request $request){
|
|
|
+ $post = UtilService::getMore([
|
|
|
+ ['page', 1],
|
|
|
+ ['pageSize', 50],
|
|
|
+ ], $request);
|
|
|
+ $post["pageSize"] = $post["pageSize"] > 50 ? 50 : (int)$post["pageSize"];
|
|
|
+ $post["page"] = $post["page"] <= 0 ? 1 : (int)$post["page"];
|
|
|
+ $where = [];
|
|
|
+ $where[] = ["u.total_invites", ">", 0];
|
|
|
+ $totalCount = $this->alias("u")->where($where)->count();
|
|
|
+ $data = null;
|
|
|
+ if($totalCount > 0){
|
|
|
+ $data = $this
|
|
|
+ ->alias("u")
|
|
|
+ ->field("u.uid, u.nickname, u.avatar, u.total_invites, u.is_type_audit, u.ancestral_place")
|
|
|
+ ->where($where)
|
|
|
+ ->order("u.total_invites", "desc")
|
|
|
+ ->page($post["page"], $post["pageSize"])
|
|
|
+ ->select();
|
|
|
+ if(!empty($data)){
|
|
|
+ $data = $data->toArray();
|
|
|
+ }
|
|
|
+ $infoAuditDb = new InfoAudit();
|
|
|
+ foreach($data as $k=>$v){
|
|
|
+ $item = $this->getShowTemplateItem($v["uid"]);
|
|
|
+ $infoData = $infoAuditDb->getItem(["status"=>1,"uid"=>$v["uid"]]);
|
|
|
+ if(!empty($infoData)){
|
|
|
+ $item["is_type_audit"] = $infoData["is_type_audit"];
|
|
|
+ $item["ancestral_place"] = $infoData["ancestral_place"];
|
|
|
+ }
|
|
|
+ $data[$k] = array_merge($v, $item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $data = empty($data) ? [] : $data;
|
|
|
+ return ["list" => $data, "pageSize" => $post["pageSize"], "page" => $post["page"], "totalCount" => $totalCount];
|
|
|
+ }
|
|
|
|
|
|
|
|
|
* 获取皮肤模板列表
|