Showing
5 changed files
with
46 additions
and
27 deletions
| @@ -124,15 +124,34 @@ class Area extends Common | @@ -124,15 +124,34 @@ class Area extends Common | ||
| 124 | /** | 124 | /** |
| 125 | * 禁用运营 | 125 | * 禁用运营 |
| 126 | */ | 126 | */ |
| 127 | - public function setAgentOperate(){ | ||
| 128 | - if(Request::isAjax()){ | ||
| 129 | - $data = Request::except('file'); | ||
| 130 | - $list= file_get_contents(ON_LINE.'App.Agent.getAgentOperate&id='.$data['id']); | ||
| 131 | - $array = json_decode($list,TRUE); | ||
| 132 | - return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'],'rel'=>1];#'count'=>$array['data'][0]['total'] | 127 | + public function setagentoperate(){ |
| 128 | + $data = Request::except('file'); | ||
| 129 | + $list= file_get_contents(ON_LINE.'App.Agent.SetAgentOperate&id='.$data['id']); | ||
| 130 | + $array = json_decode($list,TRUE); | ||
| 131 | + if($array['data']){ | ||
| 132 | + //禁止该账号登录PC站点 | ||
| 133 | + db('admin')->where('username='.$data['account'])->update(['is_open'=>0]); | ||
| 134 | + return $result = ['code'=>1,'msg'=>'操作成功!','data'=>$array['data'],'rel'=>1]; | ||
| 135 | + }else{ | ||
| 136 | + return $result = ['code'=>0,'msg'=>'操作失败!','data'=>$array['data'],'rel'=>1]; | ||
| 133 | } | 137 | } |
| 134 | $this->assign ( 'title','代理商管理'); | 138 | $this->assign ( 'title','代理商管理'); |
| 135 | - return $this->fetch(); | 139 | + } |
| 140 | + | ||
| 141 | + /** | ||
| 142 | + * 冻结商家 | ||
| 143 | + */ | ||
| 144 | + public function setfrozenseller(){ | ||
| 145 | + $data = Request::except('file'); | ||
| 146 | + $list= file_get_contents(ON_LINE.'App.Agent.FrozenAgent&areaid='.$data['id']); | ||
| 147 | + $array = json_decode($list,TRUE); | ||
| 148 | + if($array['data']){ | ||
| 149 | + return $result = ['code'=>1,'msg'=>'操作成功!','data'=>$array['data'],'rel'=>1]; | ||
| 150 | + }else{ | ||
| 151 | + return $result = ['code'=>0,'msg'=>'操作失败!','data'=>$array['data'],'rel'=>1]; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + $this->assign ( 'title','代理商管理'); | ||
| 136 | } | 155 | } |
| 137 | 156 | ||
| 138 | //增加运营管理人员 | 157 | //增加运营管理人员 |
| @@ -91,6 +91,9 @@ return [ | @@ -91,6 +91,9 @@ return [ | ||
| 91 | 'enabled'=>'已开启', | 91 | 'enabled'=>'已开启', |
| 92 | 'close'=>'关闭', | 92 | 'close'=>'关闭', |
| 93 | 'disabled'=>'已禁用', | 93 | 'disabled'=>'已禁用', |
| 94 | + 'prohibit'=>'禁用', | ||
| 95 | + 'frozen-on'=>'冻结', | ||
| 96 | + 'frozen-off'=>'已冻结', | ||
| 94 | 'yes'=>'是', | 97 | 'yes'=>'是', |
| 95 | 'no'=>'否', | 98 | 'no'=>'否', |
| 96 | 'edit'=>'编辑', | 99 | 'edit'=>'编辑', |
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | </script> | 32 | </script> |
| 33 | 33 | ||
| 34 | <script type="text/html" id="action"> | 34 | <script type="text/html" id="action"> |
| 35 | - <a class="layui-btn {{ 0==d.status?'':'layui-btn-danger'}} layui-btn-xs" lay-event="stop">{{ 0==d.status?'启用':'停用'}}</a> | 35 | + <a class="layui-btn {{ 1==d.is_frozen? 'layui-btn-disabled' :'layui-btn-danger'}} layui-btn-xs" lay-event="{{ 1==d.is_frozen? '' :'stop'}}">{{ 1==d.is_frozen ? '{:lang('frozen-off')}' : '{:lang('frozen-on')}' }}</a> |
| 36 | {{#if(d.is_exist==0){}} | 36 | {{#if(d.is_exist==0){}} |
| 37 | <a href="{:url('Area/addagent')}?areaid={{d.areaid}}" class="layui-btn layui-btn-xs">添加代理商</a> | 37 | <a href="{:url('Area/addagent')}?areaid={{d.areaid}}" class="layui-btn layui-btn-xs">添加代理商</a> |
| 38 | {{#}}} | 38 | {{#}}} |
| @@ -48,11 +48,10 @@ | @@ -48,11 +48,10 @@ | ||
| 48 | method: 'post', | 48 | method: 'post', |
| 49 | title: '代理商区域列表', | 49 | title: '代理商区域列表', |
| 50 | toolbar: '#toolbarDemo', | 50 | toolbar: '#toolbarDemo', |
| 51 | - page:true, | ||
| 52 | cols: [[ | 51 | cols: [[ |
| 53 | - {field: 'areaid', width:60, fixed: true}, | ||
| 54 | - {field: 'areaname', edit: 'text', title: '区域名称'}, | ||
| 55 | - {field: 'agent_name', edit: 'text', title: '代理商名称'}, | 52 | + {field: 'areaid',title: '区域名称', fixed: true}, |
| 53 | + {field: 'areaname', title: '区域名称'}, | ||
| 54 | + {field: 'agent_name', title: '代理商名称'}, | ||
| 56 | {align: 'center', width:200,title: '操作', toolbar: '#action'} | 55 | {align: 'center', width:200,title: '操作', toolbar: '#action'} |
| 57 | ]] | 56 | ]] |
| 58 | ,id: 'testReload' | 57 | ,id: 'testReload' |
| @@ -62,7 +61,7 @@ | @@ -62,7 +61,7 @@ | ||
| 62 | 61 | ||
| 63 | 62 | ||
| 64 | //监听行双击事件 | 63 | //监听行双击事件 |
| 65 | - table.on('rowDouble(list)', function(obj){ | 64 | + /*table.on('rowDouble(list)', function(obj){ |
| 66 | //table.on('row(list)', function(obj){ 双击事件 | 65 | //table.on('row(list)', function(obj){ 双击事件 |
| 67 | //console.log(obj.tr) //得到当前行元素对象 | 66 | //console.log(obj.tr) //得到当前行元素对象 |
| 68 | console.log(obj.data) //得到当前行数据 | 67 | console.log(obj.data) //得到当前行数据 |
| @@ -73,12 +72,12 @@ | @@ -73,12 +72,12 @@ | ||
| 73 | shade: 0.8, | 72 | shade: 0.8, |
| 74 | area: ['90%', '90%'], | 73 | area: ['90%', '90%'], |
| 75 | content: '{:url("sellerdetail")}?sid='+obj.data.id //iframe的url | 74 | content: '{:url("sellerdetail")}?sid='+obj.data.id //iframe的url |
| 76 | - /*success:function(dom){ | 75 | + success:function(dom){ |
| 77 | let $iframeDom=$(dom[0]).find("iframe").eq(0).contents(); | 76 | let $iframeDom=$(dom[0]).find("iframe").eq(0).contents(); |
| 78 | $iframeDom.find("#test").html("我是从父级传来的值哟……") | 77 | $iframeDom.find("#test").html("我是从父级传来的值哟……") |
| 79 | - }*/ | 78 | + } |
| 80 | }); | 79 | }); |
| 81 | - }); | 80 | + });*/ |
| 82 | 81 | ||
| 83 | //搜索 | 82 | //搜索 |
| 84 | $('#search').on('click', function() { | 83 | $('#search').on('click', function() { |
| @@ -136,9 +135,9 @@ | @@ -136,9 +135,9 @@ | ||
| 136 | table.on('tool(list)', function(obj){ | 135 | table.on('tool(list)', function(obj){ |
| 137 | var data = obj.data; | 136 | var data = obj.data; |
| 138 | if(obj.event === 'stop'){ | 137 | if(obj.event === 'stop'){ |
| 139 | - var statusVal = data.status==1 ? '停用' : '启用'; | 138 | + var statusVal = data.status==1 ? '已冻结' : '冻结'; |
| 140 | layer.confirm('请确定要 '+statusVal+" 该商家!", function(index){ | 139 | layer.confirm('请确定要 '+statusVal+" 该商家!", function(index){ |
| 141 | - $.post("{:url('configStop')}",{sellerid:data.id,status:data.status},function(res){ | 140 | + $.post("{:url('setfrozenseller')}",{id:data.areaid},function(res){ |
| 142 | if(res.code==1){ | 141 | if(res.code==1){ |
| 143 | layer.msg(res.msg,{time:1000,icon:1}); | 142 | layer.msg(res.msg,{time:1000,icon:1}); |
| 144 | location.reload(); | 143 | location.reload(); |
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | 11 | ||
| 12 | {include file="common/foot"/} | 12 | {include file="common/foot"/} |
| 13 | <script type="text/html" id="barDemo"> | 13 | <script type="text/html" id="barDemo"> |
| 14 | - <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a> | 14 | + <a class="layui-btn {{ 0==d.status? 'layui-btn-disabled layui-btn-xs' :'layui-btn-danger layui-btn-xs'}}" lay-event="{{ 0==d.status? '' :'del'}}">{{ 0==d.status ? '{:lang('disabled')}' : '{:lang('prohibit')}' }}</a> |
| 15 | </script> | 15 | </script> |
| 16 | 16 | ||
| 17 | <script> | 17 | <script> |
| @@ -22,10 +22,10 @@ | @@ -22,10 +22,10 @@ | ||
| 22 | url: '{:url("operate")}', | 22 | url: '{:url("operate")}', |
| 23 | method:'post', | 23 | method:'post', |
| 24 | cols: [[ | 24 | cols: [[ |
| 25 | - ,{field:'sub_openid', title: '运营公众号ID', width:280,fixed: true} | ||
| 26 | - ,{field:'openid', title: '一键订商户ID', width:270} | ||
| 27 | - ,{field:'account', title: '运营账号', width:120} | ||
| 28 | - ,{field:'cdate', title: '加入时间',width:180} | 25 | + {field:'sub_openid', title: '运营公众号ID',fixed: true} |
| 26 | + ,{field:'openid', title: '一键订商户ID'} | ||
| 27 | + ,{field:'account', title: '运营账号'} | ||
| 28 | + ,{field:'cdate', title: '加入时间'} | ||
| 29 | ,{width:160,title: '操作', align:'center', toolbar: '#barDemo'} | 29 | ,{width:160,title: '操作', align:'center', toolbar: '#barDemo'} |
| 30 | ]] | 30 | ]] |
| 31 | }); | 31 | }); |
| @@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
| 34 | var data = obj.data; | 34 | var data = obj.data; |
| 35 | if(obj.event === 'del'){ | 35 | if(obj.event === 'del'){ |
| 36 | layer.confirm('{:lang("确认禁用?")}', function(index){ | 36 | layer.confirm('{:lang("确认禁用?")}', function(index){ |
| 37 | - $.post("{:url('setAgentOperate')}",{id:data.id},function(res){ | 37 | + $.post("{:url('setagentoperate')}",{id:data.id,account:data.account},function(res){ |
| 38 | if(res.code==1){ | 38 | if(res.code==1){ |
| 39 | layer.msg(res.msg,{time:1000,icon:1}); | 39 | layer.msg(res.msg,{time:1000,icon:1}); |
| 40 | obj.del(); | 40 | obj.del(); |
| @@ -47,8 +47,6 @@ | @@ -47,8 +47,6 @@ | ||
| 47 | } | 47 | } |
| 48 | }); | 48 | }); |
| 49 | 49 | ||
| 50 | - | ||
| 51 | - | ||
| 52 | }); | 50 | }); |
| 53 | </script> | 51 | </script> |
| 54 | </body> | 52 | </body> |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | </div> | 9 | </div> |
| 10 | <div class="layui-form-item"> | 10 | <div class="layui-form-item"> |
| 11 | <div class="layui-input-block"> | 11 | <div class="layui-input-block"> |
| 12 | - <a href="{:url('operateList')}" style="margin-left: 95px" class="layui-btn">{:lang('back')}</a> | 12 | + <a href="{:url('operate')}" style="margin-left: 95px" class="layui-btn">{:lang('back')}</a> |
| 13 | </div> | 13 | </div> |
| 14 | </div> | 14 | </div> |
| 15 | </form> | 15 | </form> |
-
Please register or login to post a comment