71 lines
1.9 KiB
PHP
Executable File
71 lines
1.9 KiB
PHP
Executable File
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed ( https://opensource.org/licenses/mit-license.php )
|
|
// +----------------------------------------------------------------------
|
|
// | Author: Devil
|
|
// +----------------------------------------------------------------------
|
|
namespace app\index\controller;
|
|
|
|
use app\index\controller\Common;
|
|
|
|
/**
|
|
* 二维码生成控制层
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 0.0.1
|
|
* @datetime 2016-12-01T21:51:08+0800
|
|
*/
|
|
class QrCode extends Common
|
|
{
|
|
/**
|
|
* 构造方法
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 1.0.0
|
|
* @date 2018-11-30
|
|
* @desc description
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* 二维码显示
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 1.0.0
|
|
* @datetime 2019-04-16T21:52:09+0800
|
|
*/
|
|
public function Index()
|
|
{
|
|
if(empty($this->data_request['content']))
|
|
{
|
|
MyViewAssign('msg', MyLang('content_params_empty_tips'));
|
|
return MyView('public/tips_error');
|
|
}
|
|
(new \base\Qrcode())->View($this->data_request);
|
|
}
|
|
|
|
/**
|
|
* 二维码下载
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 1.0.0
|
|
* @datetime 2019-04-16T21:52:18+0800
|
|
*/
|
|
public function Download()
|
|
{
|
|
$ret = (new \base\Qrcode())->Download($this->data_request);
|
|
if(!empty($ret) && isset($ret['code']) && $ret['code'] != 0)
|
|
{
|
|
MyViewAssign('msg', $ret['msg']);
|
|
return MyView('public/tips_error');
|
|
}
|
|
}
|
|
}
|
|
?>
|