Commit c583ae3fbbc72da9996f8922e1443b3a7993a97e

Authored by teemitop
1 parent b5919876

设置店铺显示方式

... ... @@ -161,6 +161,7 @@ class Seller extends Common
if(Request::isAjax()){
$cuisine = !empty($data['cuisine']) ? implode(',', array_keys($data['cuisine'])) : '';
$type = !empty($data['type']) ? implode(',', array_keys($data['type'])) : '';
$mode = !empty($data['mode']) ? implode(',', array_keys($data['mode'])) : '';
if($cuisine)
$res_cuisine= file_get_contents(ON_LINE.'App.Seller.SetSellerCuisine&sellerid='.$data['sellerid'].'&cid='.$cuisine);
... ... @@ -169,6 +170,10 @@ class Seller extends Common
$res_type= file_get_contents(ON_LINE.'App.Seller.SetSellerType&sellerid='.$data['sellerid'].'&typeid='.$type);
//$res_type = json_decode($res_type,TRUE);
if($mode)
$res_mode= file_get_contents(ON_LINE.'App.Seller.setSellerMode&sellerid='.$data['sellerid'].'&modeid='.$mode);
//$res_mode = json_decode($res_mode,TRUE);
$result['code'] = 1;
$result['msg'] = "配置成功!";
return $result;
... ... @@ -204,6 +209,23 @@ class Seller extends Common
}
}
$this->assign('channel',$channel);//获取所有来源
//获取商家已有地图显示方式
$mode_list= file_get_contents(ON_LINE.'App.Seller.getSellerMode&sellerid='.$data['id']);
$mode_list = json_decode($mode_list,TRUE);
//获取所有地图显示方式
$mode= array(array('id'=>1,'name'=>'大图标'),array('id'=>2,'name'=>'文字'));
//组装数据
foreach ($mode_list['data'] as $key => $value) {
foreach ($mode as $k => $v) {
if($value['sm_id']==$v['id']){
$mode[$k]['checked'] = 1;
}
}
}
$this->assign('mode',$mode);//获取所有菜系
$this->assign ('data',$data); //商户信息
$this->assign ( 'title','商户菜品配置' );
return $this->fetch();
... ...
... ... @@ -87,7 +87,8 @@
});
//监听行双击事件
table.on('rowDouble(list)', function(obj){
table.on('rowDouble(list)', function(obj){
//table.on('row(list)', function(obj){ 双击事件
//console.log(obj.tr) //得到当前行元素对象
console.log(obj.data) //得到当前行数据
layer.open({
... ...
... ... @@ -35,6 +35,17 @@
</div>
<div class="layui-form-item">
<label class="layui-form-label">显示方式</label>
<div class="layui-input-block">
<div class="layui-input-4">
{foreach $mode as $vo}
<input type="checkbox" name="mode[{$vo.id}]" lay-skin="primary" title="{$vo.name}" {if $vo.checked==1} checked{/if}>
{/foreach}
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
<a href="{:url('sellerList')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
... ...