Files

54 lines
1.1 KiB
PHP

<?php
namespace app\admin\controller\app\recommend;
use app\common\controller\Backend;
/**
* 分销配置
*/
class Config extends Backend
{
/**
* AttachmentGroup模型对象
* @var \app\admin\model\attachment\AttachmentGroup
*/
protected $model = null;
protected $configName = 'recommend';
public function _initialize()
{
parent::_initialize();
\app\common\model\fill\Handle::check('app_config',$this->configName);
}
/**
* 获取配置
* @return mixed
*/
public function getConfig(){
$data = \app\common\model\app\Config::getConfig($this->configName);
return $this->success("获取成功",$data);
}
/**
* 获取配置
* @return mixed
*/
public function setConfig(){
$row = $this->request->post("row/a", [], 'trim');
if($row['show_count'] > 6){
$this->error('展示数量不可超出6个');
}
$data = \app\common\model\app\Config::setConfig($this->configName,$row);
return $this->success("保存成功",$data);
}
}