<?php
|
|
namespace app\api\controller\plus\team;
|
|
use app\api\controller\Controller;
|
use app\api\model\plus\team\Setting;
|
use app\api\model\plus\team\User as teamUserModel;
|
use app\common\service\qrcode\PosterService;
|
|
/**
|
* 推广二维码
|
*/
|
class Qrcode extends Controller
|
{
|
// 当前用户
|
private $user;
|
// 队长
|
private $team;
|
// 分销设置
|
private $setting;
|
|
/**
|
* 构造方法
|
*/
|
public function initialize()
|
{
|
// 用户信息
|
$this->user = $this->getUser();
|
// 队长用户信息
|
$this->team = teamUserModel::detail($this->user['user_id']);
|
// 队长设置
|
$this->setting = Setting::getAll();
|
}
|
|
/**
|
* 获取推广二维码
|
*/
|
public function poster($source)
|
{
|
$Qrcode = new PosterService($this->team, $source);
|
return $this->renderSuccess('', [
|
// 二维码图片地址
|
'qrcode' => $Qrcode->getImage(),
|
]);
|
}
|
|
}
|