初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\app\physical;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 实物商品通用配置
|
||||
*/
|
||||
class Config extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* AttachmentGroup模型对象
|
||||
* @var \app\admin\model\attachment\AttachmentGroup
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
protected $configName = 'physical';
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
|
||||
\app\common\model\fill\Handle::check('app_config', 'physical');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConfig()
|
||||
{
|
||||
$config = \app\common\model\app\Config::getConfig($this->configName);
|
||||
|
||||
if (!isset($config['auto_confirm_days'])) {
|
||||
$config['auto_confirm_days'] = '7';
|
||||
}
|
||||
|
||||
if (!isset($config['show_sales'])) {
|
||||
$config['show_sales'] = '1';
|
||||
}
|
||||
|
||||
if (!isset($config['express_app_code'])) {
|
||||
$config['express_app_code'] = '';
|
||||
}
|
||||
|
||||
return $this->success("获取成功", [
|
||||
'config' => $config
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置配置
|
||||
* @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