| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- namespace app\admin\controller;
- use think\Lang;
- class Config extends AdminControl {
- public function _initialize() {
- parent::_initialize();
- Lang::load(APP_PATH . 'admin/lang/' . config('default_lang') . '/config.lang.php');
- }
- /**
- * 网站配置
- * @return mixed
- */
- public function index() {
- $model_config = model('config');
- $allpower = $this->qxhans();
- $this->assign('allpower',$allpower);
- if (!request()->isPost()) {
- $list_config = $model_config->getListConfig();
- $this->assign('list_config', $list_config);
- $this->setAdminCurItem('index');
- return $this->fetch();
- } else {
- $update_array = array();
- // $update_array['cache_open'] = isset($_POST['cache_open']) ? '1' : '';
- // $update_array['guest_comment'] = isset($_POST['guest_comment']) ? '1' : '';
- // $update_array['words_open'] = isset($_POST['words_open']) ? '1' : '';
- // $update_array['img_open'] = isset($_POST['img_open']) ? '1' : '';
- // $update_array['voice_open'] = isset($_POST['voice_open']) ? '1' : '';
- // $update_array['video_open'] = isset($_POST['video_open']) ? '1' : '';
- $update_array['site_state'] = isset($_POST['site_state']) ? '1' : '';
- $update_array['site_name'] = $_POST['site_name'];
- $update_array['icp_number'] = $_POST['icp_number'];
- $update_array['site_phone'] = $_POST['site_phone'];
- $update_array['flow_static_code'] = $_POST['flow_static_code'];
-
- $result = $model_config->updateConfig($update_array);
- if ($result === true) {
- $this->log(lang('ds_edit') . lang('dis_dump'), 1);
- $this->success('修改成功', 'Config/index');
- } else {
- $this->log(lang('ds_edit') . lang('dis_dump'), 0);
- $this->error(lang('修改失败'));
- }
- }
- }
- /**
- * 获取卖家栏目列表,针对控制器下的栏目
- */
- protected function getAdminItemList() {
- $menu_array = array(
- array(
- 'name' => 'base',
- 'text' => lang('site_set'),
- 'url' => url('Admin/Config/index')
- ),
- );
- return $menu_array;
- }
- }
|