From bc7319b21dcaaf48b2e9db94044c00fcc15b2d0e Mon Sep 17 00:00:00 2001 From: zpc Date: Fri, 7 Mar 2025 13:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Index.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index e5f74b6..4ff19c9 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -138,6 +138,20 @@ class Index extends Base } return $this->renderSuccess('请求成功', $data); } + /** + * 邀请排行 + */ + + public function get_user_yaoqing() + { + //select * from ( SELECT pid,count(1) n FROM xinglanmh_shequt_test.`user` where pid>0 group by pid ) t where n>1 order by n desc LIMIT 10 + $list = User::where('pid', '>', 0) + ->group('pid') + ->having('COUNT(*)', '>', 1) + ->order('COUNT(*) desc') + ->select(); + return $this->renderSuccess('请求成功', $list); + } public function generate_urllink() { @@ -148,7 +162,7 @@ class Index extends Base // return $this->renderSuccess('请求成功', $user_base ); } - + public function generate_urllinks() { $userId = request()->param('userId/d', 0); @@ -159,7 +173,7 @@ class Index extends Base // $absolutePath = $currentDir . '/public/img_poster.jpg'; // ///www/wwwroot/testbaji.onelight.vip/app/public/img_poster.jpg // //www/wwwroot/testbaji.onelight.vip/public/public/img_poster.jpg - $imageData = $autoload->generatePosterWithQR( $currentDir . '/img_poster.jpg', $user_base); + $imageData = $autoload->generatePosterWithQR($currentDir . '/img_poster.jpg', $user_base); if ($imageData) { header('Content-Type: image/png'); header('Content-Length: ' . strlen($imageData)); // 设置图像长度,帮助浏览器处理流式内容