初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\live;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 直播通用配置
|
||||
*/
|
||||
class Config extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* AttachmentGroup模型对象
|
||||
* @var \app\admin\model\attachment\AttachmentGroup
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
protected $configName = 'live';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
|
||||
\app\common\model\fill\Handle::check('app_config','live');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConfig(){
|
||||
global $_W,$_GPC;
|
||||
|
||||
$config = \app\common\model\app\Config::getConfig($this->configName);
|
||||
$aliRecordBackUrl = \app\common\library\live\Url::getCallbackUrl();
|
||||
|
||||
if(!isset($config['gift_max_count'])){
|
||||
$config['gift_max_count'] = 100;
|
||||
}
|
||||
|
||||
if(!isset($config['gift'])){
|
||||
$config['gift'] = 0;
|
||||
}
|
||||
|
||||
return $this->success("获取成功",[
|
||||
'config'=>$config,
|
||||
'ali_record_back_url'=>$aliRecordBackUrl
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function setConfig(){
|
||||
$row = $this->request->post("row/a", [], 'trim');
|
||||
|
||||
$data = \app\common\model\app\Config::setConfig($this->configName,$row);
|
||||
return $this->success("保存成功",$data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user