You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

<?php
namespace app\distribution\logic;
use app\base\model\project\ProjectInfo;
use app\base\model\user\UserInfo;
use app\distribution\model\DistributionConfig;
class Poster extends Base
{
/**
* 获取我的海报数据
* @date 2022-11-08
*/
public function getPoster()
{
// 分销设置表
$config_model = new DistributionConfig();
$project_info_model = new ProjectInfo();
// 用户表
$info_model = new UserInfo();
// 服务层
$poster_service = new \app\distribution\service\Poster();
// 获取海报背景图
$distribution_bg_image = $config_model->getOneData([
['uid', '=', $this->mid]
], 'distribution_bg_image');
// 获取项目名称
$project_name = $project_info_model->getOneData([
['uid', '=', $this->mid]
], 'name');
// 获取会员信息
$info = $info_model->getUserHeadAndName();
// MAYCHANGE 不用页面或不同平台需要修改二维码生成
// 获取用户分销二维码 H5页面
$result = $poster_service->getH5DistributionCode($this->userId);
if ($result['code']) {
return json($result);
}
// 分销二维码
$user_code = $result['data']['h5_code'];
// 生成二维码
$poster = $poster_service->createPoster($distribution_bg_image, $project_name, $user_code, $info);
return sendSuccessArray([
'poster' => $poster
]);
}
}