<?php
class ControllerAccountQrcode extends Controller {
//生成微信推广二维码
public function getWechatQrcode() {
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('account/account', '', 'SSL');
$this->response->redirect($this->url->link('account/login', '', 'SSL'));
}
$this->load->model('account/customer');
//通过openid获取当前代理商ID
//$openid=$this->request->get['openid'];
$affiliate_id=$this->model_account_customer->getAffiliateIdByCustomerId();
if(!$affiliate_id){
echo "用户未注册成为代理商,无法生成推广二维码";die;
}
//判断数据里是否已经存在
$qrcodeImg=$this->model_account_customer->getQrodeImg($affiliate_id);
if(!empty($qrcodeImg)){
$data['qrcode']=HTTP_SERVER.$qrcodeImg;
}else{
//微信基本信息
$appid=
PHP生成微信临时和永久二维码
最新推荐文章于 2024-06-01 15:50:08 发布