Commit 0a446ba4cc512a1edf13500165cf3d7b926fb1e7

Authored by u123231312
1 parent a968461a

运营人员管理(二维码调取、运营人员list)

@@ -308,4 +308,37 @@ class Auth extends Common @@ -308,4 +308,37 @@ class Auth extends Common
308 return $this->fetch(); 308 return $this->fetch();
309 } 309 }
310 } 310 }
  311 +
  312 + //小饕点餐运营人员管理
  313 + public function operateList(){
  314 + if(Request::isAjax()){
  315 + //获取运营人员列表
  316 + $list= file_get_contents('http://xt04.colorcun.com/index.php?service=App.User.GetOperateList');
  317 + $array = json_decode($list,TRUE);
  318 + foreach ($array['data'] as $key=>$val){
  319 + if($val['status']==1){
  320 + $array['data'][$key]['status'] = "运营人员";
  321 + }
  322 + $array['data'][$key]['cdate'] = date("Y-m-d H:i:s",$val['cdate']);
  323 + }
  324 + if($array['ret']==200){
  325 + $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'],'rel'=>1];
  326 + }
  327 + return $result;
  328 + }
  329 + return view();
  330 + }
  331 + //增加运营管理人员
  332 + public function operateAdd(){
  333 + //缓存60秒 不请求。
  334 + $arr = cache('qrcod_url');
  335 + if(!$arr){
  336 + $arr= file_get_contents("http://xt.colorcun.com/WechatApi/WechatApi/CreateOperateQrcode/");
  337 + $arr = json_decode($arr,TRUE);
  338 + cache('qrcod_url',$arr, 50);
  339 + }
  340 +
  341 + $this->assign('qrcode_path',$arr['data']);
  342 + return view();
  343 + }
311 } 344 }
@@ -19,6 +19,7 @@ return [ @@ -19,6 +19,7 @@ return [
19 'companyAddress' =>'公司地址', 19 'companyAddress' =>'公司地址',
20 20
21 'admin'=>'管理员', 21 'admin'=>'管理员',
  22 + 'operate'=>'运营人员',
22 'module'=>'模型', 23 'module'=>'模型',
23 24
24 'user'=>'会员', 25 'user'=>'会员',
  1 +{include file="common/head"/}
  2 +<div class="admin-main fadeInUp animated" ng-app="hd" ng-controller="ctrl">
  3 + <fieldset class="layui-elem-field layui-field-title">
  4 + <legend>请扫描二维码完成操作</legend>
  5 + </fieldset>
  6 + <form class="layui-form layui-form-pane">
  7 + <div class="layui-form-item">
  8 + <label class="layui-form-label" style="height: 465px;width: 500px;"><img style="margin: 20px;height: 400px;width: 400px;" src="{$qrcode_path}"/></label>
  9 + </div>
  10 + <div class="layui-form-item">
  11 + <div class="layui-input-block">
  12 + <a href="{:url('operateList')}" style="margin-left: 95px" class="layui-btn">{:lang('back')}</a>
  13 + </div>
  14 + </div>
  15 + </form>
  16 +</div>
  17 +{include file="common/foot"/}
  1 +{include file="common/head"/}
  2 +<div class="admin-main layui-anim layui-anim-upbit">
  3 + <fieldset class="layui-elem-field layui-field-title">
  4 + <legend>{:lang('operate')}{:lang('list')}</legend>
  5 + </fieldset>
  6 + <blockquote class="layui-elem-quote">
  7 + <a href="{:url('operateAdd')}" class="layui-btn layui-btn-sm">{:lang('add')}{:lang('operate')}</a>
  8 + </blockquote>
  9 + <table class="layui-table" id="list" lay-filter="list"></table>
  10 +</div>
  11 +
  12 +{include file="common/foot"/}
  13 +<script type="text/html" id="barDemo">
  14 + <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
  15 +</script>
  16 +
  17 +<script>
  18 + layui.use(['table','form'], function() {
  19 + var table = layui.table,form = layui.form,$ = layui.jquery;
  20 + var tableIn = table.render({
  21 + elem: '#list',
  22 + url: '{:url("operateList")}',
  23 + method:'post',
  24 + cols: [[
  25 + {field:'id', title: '主键ID', width:80,fixed: true}
  26 + ,{field:'openid', title: '运营授权ID', width:280,fixed: true}
  27 + ,{field:'seller_openid', title: '微信openid', width:270}
  28 + ,{field:'seller_nickname', title: '微信昵称', width:120}
  29 + ,{field:'status', title: '用户身份',width:120}
  30 + ,{field:'cdate', title: '加入时间',width:180}
  31 + ,{width:160,title: '操作', align:'center', toolbar: '#barDemo'}
  32 + ]]
  33 + });
  34 + //删除运营人员
  35 + table.on('tool(list)', function(obj){
  36 + var data = obj.data;
  37 + if(obj.event === 'del'){
  38 + layer.confirm('{:lang("Are you sure you want to delete it")}', function(index){
  39 + $.post("{:url('operateDel')}",{admin_id:data.admin_id},function(res){
  40 + if(res.code==1){
  41 + layer.msg(res.msg,{time:1000,icon:1});
  42 + obj.del();
  43 + }else{
  44 + layer.msg(res.msg,{time:1000,icon:2});
  45 + }
  46 + });
  47 + layer.close(index);
  48 + });
  49 + }
  50 + });
  51 +
  52 +
  53 +
  54 + });
  55 +</script>
  56 +</body>
  57 +</html>