作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

合并分支 '1iuzhen' 到 'master'

表单类型收集功能添加,前台逻辑验证添加



查看合并请求 !236
... ... @@ -195,4 +195,54 @@ class OrderSortController extends AdminBaseController
}
$this->success('删除成功');
}
/**
* 修改类型收集状态
* @adminMenu(
* 'name' => '修改类型收集状态',
* 'parent' => 'index',
* 'display'=> false,
* 'hasView'=> false,
* 'order' => 6,
* 'icon' => '',
* 'remark' => '修改类型收集状态',
* 'param' => ''
* )
*/
public function stop()
{
$param = $this->request->param();
$msg = '';
if (isset($param['ids']) && isset($param["is_stop"])) {
$stop = $param["is_stop"];
$ids = $this->request->param('ids/a');
$this->order_sort_model->where(['id' => ['in', $ids]])->update(['is_stop' => $stop, 'update_time' => time()]);
if($stop == 0) {
$msg = "开启收集成功!";
}
if($stop == 1) {
$msg = "停止收集成功!";
}
$this->success($msg, '');
}
if (isset($param['id']) && isset($param["is_stop"])) {
$stop = $param["is_stop"];
$id = $this->request->param('id');
$this->order_sort_model->where(['id' => $id])->update(['is_stop' => $stop, 'update_time' => time()]);
if($stop == 0) {
$msg = "开启收集成功!";
}
if($stop == 1) {
$msg = "停止收集成功!";
}
$this->success($msg,'');
}
}
}
\ No newline at end of file
... ...
... ... @@ -123,7 +123,7 @@ class MemberSalesController extends HomeBaseController
];
$allow_order = Db::name('MemberSales')->where($where)->value('allow_order');
$allow_order_array = explode(',',$allow_order);
$typeList = $this->singleData($this->table,['id'=>['in',$allow_order_array],'delete_time'=>0],1);
$typeList = $this->singleData($this->table,['id'=>['in',$allow_order_array],'is_stop'=>0,'delete_time'=>0],1);
$this->assign('typeList',$typeList);
return $this->fetch();
}
... ... @@ -141,6 +141,12 @@ class MemberSalesController extends HomeBaseController
'delete_time' => 0
];
$typeInfo = $this->singleData($this->table,$where);
if(empty($typeInfo)) {
$this->error('该表单类型不存在');
}
if($typeInfo['is_stop'] == 1) {
$this->error('该表单类型已关闭,无法添加电子订单');
}
$typeInfo['options'] = json_decode($typeInfo['options'],true);
$goodsList = [];
$default = 0;
... ...
... ... @@ -34,9 +34,10 @@
<th width="50">ID</th>
<th>类型名称</th>
<th>图标</th>
<th>收集状态</th>
<th width="130">更新时间</th>
<th width="130">发布时间</th>
<th width="120">操作</th>
<th width="150">操作</th>
</tr>
</thead>
<foreach name="list" item="vo">
... ... @@ -52,11 +53,18 @@
<img src="{:cmf_get_image_preview_url($vo.icon)}" width="50"/>
</a>
</td>
<td><eq name="vo.is_stop" value="0">收集中</eq><eq name="vo.is_stop" value="1">已停止</eq></td>
<td>{:date('Y-m-d H:i',$vo.create_time)}</td>
<td>{:date('Y-m-d H:i',$vo.update_time)}</td>
<td>
<!--<a href="{:url('OrderSort/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>-->
<a href="javascript:parent.openIframeDialog('{:url('Order/index_sort',['sort_id'=>$vo['id']])}','电子订单列表',{width:'1300px',height:'750px'});">查看订单</a>
<eq name="vo.is_stop" value="0">
<a href="{:url('OrderSort/stop',array('id'=>$vo['id'],'is_stop'=>1))}" class="js-ajax-dialog-btn" data-msg="确定停止收集吗?">停止</a>
</eq>
<eq name="vo.is_stop" value="1">
<a href="{:url('OrderSort/stop',array('id'=>$vo['id'],'is_stop'=>0))}" class="js-ajax-dialog-btn" data-msg="确定开启收集吗?">收集</a>
</eq>
<a href="{:url('OrderSort/delete',['id'=>$vo['id']])}" class="js-ajax-delete">{:lang('DELETE')}</a>
</td>
</tr>
... ... @@ -68,6 +76,7 @@
<th width="50">ID</th>
<th>类型名称</th>
<th>图标</th>
<th>收集状态</th>
<th width="130">更新时间</th>
<th width="130">发布时间</th>
<th width="90">操作</th>
... ...