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