first commit
This commit is contained in:
42
application/mobile/controller/Invite.php
Normal file
42
application/mobile/controller/Invite.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\mobile\controller;
|
||||
|
||||
use app\common\model\MemberInfo as MemberInfoModel;
|
||||
use Endroid\QrCode\QrCode;
|
||||
|
||||
class Invite extends _Init
|
||||
{
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->nav = 5;
|
||||
}
|
||||
|
||||
public function index($uid = '')
|
||||
{
|
||||
if (empty($uid)) {
|
||||
$uid == UID;
|
||||
}
|
||||
$qr = new QrCode();
|
||||
$url = url('login/reg', 'invite=' . $uid);
|
||||
$this->img = $qr->setText($url)->setSize(350)->writeDataUri();
|
||||
|
||||
$info = MemberInfoModel::get($uid);
|
||||
if (empty($info)) {
|
||||
$this->redirect('login/info', 'title=邀请人已经被删除或者禁用');
|
||||
}
|
||||
$info['description'] = '';
|
||||
$info['title'] = $info['nickname'];
|
||||
$info['thumb'] = $info['avatar'];
|
||||
$this->assign('info', $info);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user