作者 徐治堂

系统消息发布消息上限设置,网站基本信息发件人信息设置

... ... @@ -37,6 +37,12 @@ class ZjNewsController extends AdminBaseController
if ($this->request->param()){
$arr=input('param.');
$arr['create_time']=time();
if($arr['is_sta']==1){
$num=Db::name('zj_news')->where(['is_sta'=>1,'delete_time'=>0])->count();
if ($num>=3){
$this->error('最多同时发布三条系统消息');
}
}
$add=Db::name('zj_news')->insert($arr);
if ($add){
$this->success('添加成功',url('index'));
... ... @@ -63,6 +69,12 @@ class ZjNewsController extends AdminBaseController
public function editPost(){
if ($this->request->param()){
$arr=input('param.');
if($arr['is_sta']==1){
$num=Db::name('zj_news')->where(['is_sta'=>1,'delete_time'=>0])->count();
if ($num>=3){
$this->error('最多同时发布三条系统消息');
}
}
$edit=Db::name('zj_news')->update($arr);
if ($edit){
$this->success('保存成功',url('index'));
... ... @@ -73,11 +85,17 @@ class ZjNewsController extends AdminBaseController
}
/**
* 系统消息启用禁用
* 系统消息发布状态
*/
public function sta(){
if ($this->request->param()){
$arr=input('param.');
if($arr['is_sta']==1){
$num=Db::name('zj_news')->where(['is_sta'=>1,'delete_time'=>0])->count();
if ($num>=3){
$this->error('最多同时发布三条系统消息');
}
}
$edit=Db::name('zj_news')->update($arr);
if ($edit){
$this->success('设置成功');
... ...
此 diff 太大无法显示。
... ... @@ -3,8 +3,8 @@
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('index')}">分类管理</a></li>
<li class="active"><a href="{:url('add')}">添加分类</a></li>
<li><a href="{:url('index')}">系统消息列表</a></li>
<li class="active"><a href="{:url('add')}">添加系统消息</a></li>
</ul>
<div class="row margin-top-20">
<div class="col-md-6">
... ...
... ... @@ -3,9 +3,9 @@
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li><a href="{:url('index')}">分类管理</a></li>
<li><a href="{:url('add')}">添加分类</a></li>
<li class="active"><a href="javascript:;">编辑分类</a></li>
<li><a href="{:url('index')}">系统消息列表</a></li>
<li><a href="{:url('add')}">添加系统消息</a></li>
<li class="active"><a href="javascript:;">编辑系统消息</a></li>
</ul>
<div class="row margin-top-20">
<div class="col-md-6">
... ...
... ... @@ -14,7 +14,7 @@
<th>标题</th>
<th>内容</th>
<th style="width: 130px;">添加时间</th>
<th style="width: 50px;">状态</th>
<th style="width: 80px;">状态</th>
<th style="width: 130px;">操作</th>
</tr>
</thead>
... ...
... ... @@ -14,7 +14,7 @@
<div class="form-group">
<label for="mobile"><span class="form-required">*</span>退款客服电话</label>
<div>
<input type="text" class="form-control" value="{$one.mobile}" id="mobile" name="mobile">
<input type="text" class="form-control" required value="{$one.mobile}" id="mobile" name="mobile">
</div>
</div>
<div class="form-group">
... ... @@ -26,7 +26,32 @@
<div class="form-group">
<label for="integral"><span class="form-required">*</span>返佣比例</label>
<div>
<input type="number" class="form-control" id="integral" value="{$one.integral}" name="integral">
<input type="number" class="form-control" required id="integral" value="{$one.integral}" name="integral">
</div>
</div>
<div class="form-group">
<label for="integral"><span class="form-required">*</span>发货人信息</label>
<div>
<div class="col-md-5">发货人:<input type="text" required style="width: 80%;display: inline-block;" class="form-control" id="name" value="{$one.name}" name="name"></div>
<div class="col-md-5">手机号:<input type="number" required style="width: 80%;display: inline-block;" class="form-control" id="fmobile" value="{$one.fmobile}" name="fmobile"></div>
</div>
</div>
<br/>
<br/>
<br/>
<div class="form-group">
<label><span class="form-required">*</span>发货地址</label><br/>
<div class="col-md-3">省:<select required class="form-control " name="province" style="width: 80%;display: inline-block;" id="province" onchange="province1(this)"></select></div>
<div class="col-md-3">市:<select required class="form-control " name="city" style="width: 80%;display: inline-block;" id="city" onchange="city1(this)"></select></div>
<div class="col-md-3">区:<select required class="form-control " name="county" style="width: 80%;display: inline-block;" id="county"></select></div>
</div>
<br/>
<br/>
<br/>
<div class="form-group">
<label for="integral"><span class="form-required">*</span>详细地址</label>
<div>
<input type="text" required class="form-control" id="place" value="{$one.place}" name="place">
</div>
</div>
</div>
... ... @@ -39,6 +64,81 @@
</div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/city-picker.js"></script>
<script>
var pla=$.rawCitiesData
var ci=document.getElementById('city')
var co=document.getElementById('county')
$(function () {
var pr=document.getElementById('province')
var arr1=[];
var arr2=[];
for (i=0;i<pla.length;i++){
if (pla[i].name=="{$one.province}"){
arr1=pla[i].sub
for (l=0;l<arr1.length;l++){
if (arr1[l].name=="{$one.city}"){
arr2=arr1[l].sub
}
}
}
}
ff(pr,pla,"{$one.province}")
ff(ci,arr1,"{$one.city}")
ff(co,arr2,"{$one.county}")
})
//选择省
function province1(_this) {
var arr1=[];
for (i=0;i<pla.length;i++){
if (pla[i].name==_this.value){
arr1=pla[i].sub
}
}
rem(ci)
rem(co)
ff(ci,arr1)
}
//选择市
function city1(_this) {
var pr=document.getElementById('province')
var arr1=[];
for (i=0;i<pla.length;i++){
if (pla[i].name==pr.value){
for (l=0;l<pla[i].sub.length;l++){
if (pla[i].sub[l].name==_this.value){
arr1=pla[i].sub[l].sub
}
}
}
}
rem(co)
ff(co,arr1)
}
//添加option
function ff(_this,arr,_name) {
for(i=0;i<arr.length;i++){
var opt=document.createElement('option');
if (arr[i].name==_name){
opt.selected=true;
}
opt.text=arr[i].name;
opt.value=arr[i].name;
_this.add(opt);
}
}
//删除option
function rem(_this) {
for(i=_this.options.length-1;i>=0;i--){
_this.remove(i)
}
}
</script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
... ...