邀请排行

This commit is contained in:
zpc 2025-03-07 13:57:24 +08:00
parent ba1898f389
commit bc7319b21d

View File

@ -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)); // 设置图像长度,帮助浏览器处理流式内容