作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

  1 +<?php
  2 +/**
  3 + * Created by PhpStorm.
  4 + * User: ruidiudiu
  5 + * Date: 2018/11/14
  6 + * Time: 10:09
  7 + */
  8 +
  9 +namespace app\portal\controller;
  10 +
  11 +
  12 +use cmf\controller\AdminBaseController;
  13 +use think\Db;
  14 +
  15 +/**
  16 + * Class AdminSetUpController
  17 + * @package app\portal\controller
  18 + * @adminMenuRoot(
  19 + * 'name' =>'参数设置',
  20 + * 'action' =>'index',
  21 + * 'parent' =>'',
  22 + * 'display'=> true,
  23 + * 'order' => 30,
  24 + * 'icon' =>'th',
  25 + * 'remark' =>'参数设置'
  26 + * )
  27 + */
  28 +class AdminSetUpController extends AdminBaseController{
  29 +
  30 + public function index(){
  31 + $data=Db::name('set_up')->where('id',1)->find();
  32 + $this->assign('setup',$data);
  33 + return $this->fetch();
  34 + }
  35 +
  36 + public function setupPost(){
  37 + $param=$this->request->param();
  38 + $res=Db::name('set_up')->where('id',1)->update($param);
  39 + if ($res){
  40 + $this->success('保存完成');
  41 + }else{
  42 + $this->error('保存失败');
  43 + }
  44 + }
  45 +}
  1 +<include file="public@header" />
  2 +</head>
  3 +<body>
  4 + <div class="wrap">
  5 + <ul class="nav nav-tabs">
  6 + <li class="active"><a>系统参数设置</a></li>
  7 + </ul>
  8 + <form method="post" class="js-ajax-form margin-top-20" role="form" action="{:url('adminSetup/setupPost')}">
  9 + <div class="form-group">
  10 + <label>旁听金额(单位:元)</label>
  11 + <div class="row">
  12 + <div class="col-md-8">
  13 + <input type="number" class="form-control" name="commission" placeholder="单位:元" value="{$setup.price}">
  14 + </div>
  15 + <div class="col-md-8">
  16 + </div>
  17 + </div>
  18 + <p class="help-block">设置用户旁听问题需要缴纳的金额</p>
  19 + </div>
  20 +
  21 + <div class="form-group">
  22 + <label>客服电话</label>
  23 + <div class="row">
  24 + <div class="col-md-8">
  25 + <input type="text" class="form-control" name="refund_time" min="1" max="100" placeholder="使用整数表示,单位:小时(如:24小时填写24即可)" value="{$setup.service_phone}">
  26 + </div>
  27 + <div class="col-md-8">
  28 + <!--<input type="text" class="form-control" name="file_types[image][extensions]" title="扩展名,以英文逗号分隔" placeholder="扩展名,以英文逗号分隔" value="{$file_types.image.extensions|default='jpg,jpeg,png,gif,bmp'}">-->
  29 + </div>
  30 + </div>
  31 + <p class="help-block">当用户提问的问题专家未回答时,会在此设置时间之后将提问取消,并将提问金额返回给提问者。使用整数表示,单位:小时(如:24小时填写24即可)</p>
  32 + </div>
  33 +
  34 + <div class="form-group">
  35 + <label>计费规则</label>
  36 + <div class="row">
  37 + <div class="col-md-8">
  38 + <script type="text/plain" id="agreement" name="agreement">{$setup.bill_rules}</script>
  39 + </div>
  40 + <div class="col-md-8">
  41 + <!--<input type="text" class="form-control" name="file_types[image][extensions]" title="扩展名,以英文逗号分隔" placeholder="扩展名,以英文逗号分隔" value="{$file_types.image.extensions|default='jpg,jpeg,png,gif,bmp'}">-->
  42 + </div>
  43 + </div>
  44 + <p class="help-block">设置成为答主的服务协议</p>
  45 + </div>
  46 +
  47 + <div class="form-group">
  48 + <label>使用须知</label>
  49 + <div class="row">
  50 + <div class="col-md-8">
  51 + <script type="text/plain" id="disclaimer" name="disclaimer">{$setup.directions}</script>
  52 + </div>
  53 + <div class="col-md-8">
  54 + <!--<input type="text" class="form-control" name="file_types[image][extensions]" title="扩展名,以英文逗号分隔" placeholder="扩展名,以英文逗号分隔" value="{$file_types.image.extensions|default='jpg,jpeg,png,gif,bmp'}">-->
  55 + </div>
  56 + </div>
  57 + <p class="help-block">设置检测报告的免责声明</p>
  58 + </div>
  59 + <div class="form-group">
  60 + <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
  61 + </div>
  62 + </form>
  63 + </div>
  64 + <script src="__STATIC__/js/admin.js"></script>
  65 + <script type="text/javascript">
  66 + //编辑器路径定义
  67 + var editorURL = GV.WEB_ROOT;
  68 + </script>
  69 + <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
  70 + <script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
  71 +</body>
  72 +</html>
  73 +<script>
  74 + $(function () {
  75 +
  76 + editorcontent = new baidu.editor.ui.Editor();
  77 + editorcontent.render('agreement');
  78 + try {
  79 + editorcontent.sync();
  80 + } catch (err) {
  81 + }
  82 +
  83 + editorcontent = new baidu.editor.ui.Editor();
  84 + editorcontent.render('disclaimer');
  85 + try {
  86 + editorcontent.sync();
  87 + } catch (err) {
  88 + }
  89 +
  90 + editorcontent = new baidu.editor.ui.Editor();
  91 + editorcontent.render('rule');
  92 + try {
  93 + editorcontent.sync();
  94 + } catch (err) {
  95 + }
  96 +
  97 + editorcontent = new baidu.editor.ui.Editor();
  98 + editorcontent.render('about_us');
  99 + try {
  100 + editorcontent.sync();
  101 + } catch (err) {
  102 + }
  103 +
  104 +
  105 + });
  106 +</script>