作者 景龙
1 个管道 的构建 通过 耗费 7 秒

增加后台关于我们联系客服

<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use app\admin\model\AboutUsModel;
use think\Db;
class SysInformationController extends AdminBaseController
{
//编辑页面
public function edit(){
$res = Db::name('about_us')->where(['id'=>1])->field('id,information')->find();
$this->assign('post', $res);
return $this->fetch();
}
//编辑保存页面
public function editPost(){
$data = $this->request->param();
$AboutUsModel = new AboutUsModel();
$AboutUsModel->allowField(true)->isUpdate(true)->save($data);
$this->success("保存成功!");
}
}
\ No newline at end of file
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use app\admin\model\AboutUsModel;
use think\Db;
class SysServiceController extends AdminBaseController
{
//编辑页面
public function edit(){
$res = Db::name('about_us')->where(['id'=>1])->field('id,service_mobile')->find();
$this->assign('post', $res);
return $this->fetch();
}
//编辑保存页面
public function editPost(){
$data = $this->request->param();
$AboutUsModel = new AboutUsModel();
$AboutUsModel->allowField(true)->isUpdate(true)->save($data);
$this->success("保存成功!");
}
}
\ No newline at end of file
... ...
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\admin\model;
use think\Model;
class AboutUsModel extends Model
{
}
\ No newline at end of file
... ...
... ... @@ -93,6 +93,8 @@ return array (
'ADMIN_SLIDEITEM_LISTORDER' => '幻灯片页面排序',
'ADMIN_STORAGE_INDEX' => '文件存储',
'ADMIN_STORAGE_SETTINGPOST' => '文件存储设置提交',
'ADMIN_SYSINFORMATION_EDIT' => '系统消息',
'ADMIN_SYSSERVICE_EDIT' => '联系客服',
'ADMIN_THEME_ACTIVE' => '启用模板',
'ADMIN_THEME_DATASOURCE' => '模板文件设置数据源',
'ADMIN_THEME_DESIGN' => '模板设计',
... ...
<include file="public@header"/>
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="#">编辑系统消息</a></li>
</ul>
<form action="{:url('SysInformation/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">系统消息<span class="form-required">*</span></th>
<td>
<input id="post-id" type="hidden" name="id" value="{$post.id}">
<input class="form-control" type="text" name="information" required value="{$post.information}" placeholder="请输入系统消息"/>
</td>
</tr>
</table>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
</body>
</html>
... ...
<include file="public@header"/>
<style type="text/css">
.pic-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="#">编辑联系客服</a></li>
</ul>
<form action="{:url('SysService/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<th width="100">系统消息<span class="form-required">*</span></th>
<td>
<input id="post-id" type="hidden" name="id" value="{$post.id}">
<input class="form-control" type="number" name="service_mobile" required value="{$post.service_mobile}" placeholder="请输入联系客服"/>
</td>
</tr>
</table>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
</body>
</html>
... ...