admin/addon/goodscircle/shop/controller/Config.php

48 lines
1.5 KiB
PHP

<?php
/**
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
* =========================================================
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
* ----------------------------------------------
* 官方网址: https://www.cdcloudshop.com
* =========================================================
*/
namespace addon\goodscircle\shop\controller;
use app\shop\controller\BaseShop;
use addon\goodscircle\model\Config as ConfigModel;
/**
* 满减控制器
*/
class Config extends BaseShop
{
protected $replace = []; //视图输出字符串内容替换 相当于配置文件中的'view_replace_str'
public function __construct()
{
parent::__construct();
$this->replace = [
'CIRCLE_CSS' => __ROOT__ . '/addon/goodscircle/shop/view/public/css',
'CIRCLE_JS' => __ROOT__ . '/addon/goodscircle/shop/view/public/js',
'CIRCLE_IMG' => __ROOT__ . '/addon/goodscircle/shop/view/public/img',
];
}
public function index()
{
$config_model = new ConfigModel();
if (request()->isAjax()) {
$data = [];
$is_use = input('is_use', 0);
return $config_model->setGoodscircleConfig($data, $is_use, $this->site_id);
} else {
$config = $config_model->getGoodscircleConfig($this->site_id);
$this->assign('config', $config['data']);
return $this->fetch("config/index", [], $this->replace);
}
}
}