67 lines
1.3 KiB
PHP
67 lines
1.3 KiB
PHP
<?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);
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|