quanwei
2025-11-21 2d9362ae6f528f57e6133d5d80f0b633c24e8eb6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
 
namespace app\api\controller\plus\vip;
 
use app\api\controller\Controller;
use app\api\model\plus\vip\User as VipUserModel;
use app\common\service\qrcode\PosterService;
use app\api\model\plus\vip\Setting;
/**
 * VIP专区二维码
 */
class Qrcode extends Controller
{
 
 
    // 当前用户
    private $user;
    // 分销商
    private $agent;
    // 分销设置
    private $setting;
 
    /**
     * 构造方法
     */
    public function initialize()
    {
        // 用户信息
        $this->user = $this->getUser();
        // 分销商用户信息
        $this->agent = VipUserModel::detail($this->user['user_id']);
        // 分销商设置
        $this->setting = Setting::getAll();
    }
 
    /**
     * 获取推广二维码
     */
    public function poster($source)
    {
        $Qrcode = new PosterService($this->agent, $source);
        return $this->renderSuccess('', [
            // 二维码图片地址
            'qrcode' => $Qrcode->getImage(),
        ]);
    }
 
}