123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- /**
- * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
- * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
- * @author pillar<ltmn@qq.com>
- * 文字配置
- */
- namespace app\citys\controller;
- use app\citys\model\CitysPage;
- use think\facade\Request;
- class Page extends Common {
- public function initialize() {
- parent::initialize();
- $this->assign('pathMaps', [['name'=>'权益声明','url'=>'javascript:;']]);
- }
- /**
- * 免责申明
- */
- public function index(){
- $companyInfo = CitysPage::where($this->mini_program)->find();
- $this->assign('companyInfo',$companyInfo);
- return $this->fetch();
- }
- /**
- * 关于我们
- */
- public function about(){
- $companyInfo = CitysPage::where($this->mini_program)->find();
- $this->assign('companyInfo',$companyInfo);
- return $this->fetch();
- }
- /**
- * 服务协议
- */
- public function agreement(){
- $companyInfo = CitysPage::where($this->mini_program)->find();
- $this->assign('companyInfo',$companyInfo);
- return $this->fetch();
- }
- /**
- * 防骗警示
- */
- public function fraud(){
- $companyInfo = CitysPage::where($this->mini_program)->find();
- $this->assign('companyInfo',$companyInfo);
- return $this->fetch();
- }
- /**
- * 客服电话
- */
- public function tel(){
- $companyInfo = CitysPage::where($this->mini_program)->find();
- $this->assign('companyInfo',$companyInfo);
- return $this->fetch();
- }
-
- /**
- * 信息修改
- */
- public function update(){
- if(Request::instance()->isPost()){
- switch ($this->request->param('type/d')) {
- case 1:
- $data['disclaimer'] = $this->request->param('disclaimer');
- break;
- case 2:
- $data['about'] = $this->request->param('about');
- break;
- case 3:
- $data['agreement'] = $this->request->param('agreement');
- break;
- case 4:
- $param['title'] = $this->request->param('title/a');
- $param['phone'] = $this->request->param('phone/a');
- $phone = [];
- foreach ($param['title'] as $key => $value) {
- $phone[$key]['title'] = $value;
- $phone[$key]['phone'] = $param['phone'][$key] ?: 0;
- }
- $data['phone'] = $phone;
- break;
- case 5:
- $data['fraud'] = $this->request->param('fraud');
- break;
- default:
- return enjson(401,'设置失败');
- break;
- }
- $res = CitysPage::where($this->mini_program)->find();
- if($res){
- $res = CitysPage::where($this->mini_program)->update($data);
- }else{
- $data['member_miniapp_id'] = $this->member_miniapp_id;
- $res = CitysPage::create($data);
- }
- return enjson($res?200:0);
- }
- }
- }
|