Commit 32129bfb674f4cecfd8fd1588cf588658af3402e

Authored by teemitop
1 parent 1584ba91

PC运营消息推送处理

@@ -12,7 +12,8 @@ class Operational extends Common @@ -12,7 +12,8 @@ class Operational extends Common
12 $channel = @$key['channel'] ? @$key['channel'] : 1; 12 $channel = @$key['channel'] ? @$key['channel'] : 1;
13 $user_groups = @$key['user_groups'] ? @$key['user_groups'] : 2; 13 $user_groups = @$key['user_groups'] ? @$key['user_groups'] : 2;
14 $role = @$key['role'] ? @$key['role'] : ''; 14 $role = @$key['role'] ? @$key['role'] : '';
15 - $limit = '&offset='.$data["page"].'&size='.$data["limit"].'&keywords='.@$key['id'].'&channel='.$channel.'&role='.$role.'&user_groups='.$user_groups; 15 + $patt = @$key['patt'] ? @$key['patt'] : 1;
  16 + $limit = '&offset='.$data["page"].'&size='.$data["limit"].'&keywords='.@$key['id'].'&channel='.$channel.'&role='.$role.'&user_groups='.$user_groups.'&patt='.$patt;
16 17
17 $list= file_get_contents(ON_LINE.'App.Message.GetFormidList'.$limit); 18 $list= file_get_contents(ON_LINE.'App.Message.GetFormidList'.$limit);
18 $array = json_decode($list,TRUE); 19 $array = json_decode($list,TRUE);
@@ -22,7 +23,11 @@ class Operational extends Common @@ -22,7 +23,11 @@ class Operational extends Common
22 $array['data'][$key]['sellerinfo'] = $value['id'].'-'.$value['sellername']; 23 $array['data'][$key]['sellerinfo'] = $value['id'].'-'.$value['sellername'];
23 $array['data'][$key]['expire_in'] = $value['expire_in'] ? date('Y-m-d H:i:s',$value['expire_in']) : ''; 24 $array['data'][$key]['expire_in'] = $value['expire_in'] ? date('Y-m-d H:i:s',$value['expire_in']) : '';
24 $array['data'][$key]['wx/app'] = $value['wx'].' / '.$value['app']; 25 $array['data'][$key]['wx/app'] = $value['wx'].' / '.$value['app'];
  26 + if($patt==2){
  27 + $array['data'][$key]['role_name'] = '顾客';
  28 + }
25 } 29 }
  30 +
26 return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'],'count'=>intval($total),'rel'=>1]; 31 return $result = ['code'=>0,'msg'=>'获取成功!','data'=>$array['data'],'count'=>intval($total),'rel'=>1];
27 } 32 }
28 $this->assign ( 'title','运营消息推广'); 33 $this->assign ( 'title','运营消息推广');
@@ -6,39 +6,51 @@ @@ -6,39 +6,51 @@
6 </fieldset> 6 </fieldset>
7 7
8 <div class="demoTable"> 8 <div class="demoTable">
  9 + <form class="layui-form layui-form-pane">
9 <div class="layui-form"> 10 <div class="layui-form">
10 - 搜索商家:<div class="layui-inline">  
11 - <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}店铺名称" autocomplete="off">  
12 - </div>  
13 - 角色选择: <div class="layui-inline">  
14 - <input type="checkbox" name="role[1]" value='管理员' title="管理员">  
15 - <input type="checkbox" name="role[2]" value="店长" title="店长">  
16 - <input type="checkbox" name="role[3]" value="收银员" title="收银员">  
17 - <input type="checkbox" name="role[4]" value="服务员" title="服务员">  
18 - <input type="checkbox" name="role[5]" value="客户经理" title="客户经理">  
19 - </div>  
20 - 商家来源:  
21 - <div class="layui-input-inline layui-form">  
22 - <div class="layui-input-8">  
23 - <select name="class" id="channel" lay-filter="myselect">  
24 - <option value="1">合作</option>  
25 - <option value="2">推广</option>  
26 - <option value="3">测试</option>  
27 - </select>  
28 - </div>  
29 - </div>  
30 - 用户群体:  
31 - <div class="layui-input-inline layui-form">  
32 - <div class="layui-input-8">  
33 - <select name="class" id="user_groups" lay-filter="myselect">  
34 - <option value="1">全部用户</option>  
35 - <option value="2" selected = "selected">可发送</option>  
36 - <option value="3">不可发送</option>  
37 - </select>  
38 - </div>  
39 - </div>  
40 - <button class="layui-btn" id="search" data-type="reload">搜索</button> 11 + 搜索商家:<div class="layui-inline">
  12 + <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}店铺名称" autocomplete="off">
  13 + </div>
  14 + 模式:
  15 + <div class="layui-input-inline layui-form">
  16 + <div class="layui-input-4" style="width:80px">
  17 + <select name="patt" id="patt" lay-filter="patt">
  18 + <option value="1">商户</option>
  19 + <option value="2">顾客</option>
  20 + </select>
  21 + </div>
  22 + </div>
  23 + <div id = 'role_'>
  24 + 角色选择: <div class="layui-inline">
  25 + <input type="checkbox" name="role[1]" value='管理员' title="管理员">
  26 + <input type="checkbox" name="role[2]" value="店长" title="店长">
  27 + <input type="checkbox" name="role[3]" value="收银员" title="收银员">
  28 + <input type="checkbox" name="role[4]" value="服务员" title="服务员">
  29 + <input type="checkbox" name="role[5]" value="客户经理" title="客户经理">
  30 + </div>
  31 + </div>
  32 + 商家来源:<div class="layui-input-inline layui-form">
  33 + <div class="layui-input-4" style="width:80px">
  34 + <select name="class" id="channel" lay-filter="myselect">
  35 + <option value="1">合作</option>
  36 + <option value="2">推广</option>
  37 + <option value="3">测试</option>
  38 + </select>
  39 + </div>
  40 + </div>
  41 + 用户群体:
  42 + <div class="layui-input-inline layui-form">
  43 + <div class="layui-input-8">
  44 + <select name="class" id="user_groups" lay-filter="myselect">
  45 + <option value="1">全部用户</option>
  46 + <option value="2" selected = "selected">可发送</option>
  47 + <option value="3">不可发送</option>
  48 + </select>
  49 + </div>
  50 + </div>
  51 + <button type="button" class="layui-btn" id="search" data-type="reload">搜索</button>
41 </div> 52 </div>
  53 + </form>
42 54
43 </div> 55 </div>
44 56
@@ -52,7 +64,7 @@ @@ -52,7 +64,7 @@
52 {include file="common/foot"/} 64 {include file="common/foot"/}
53 <script> 65 <script>
54 layui.use(['table','form'], function() { 66 layui.use(['table','form'], function() {
55 - var table = layui.table,$ = layui.jquery; 67 + var table = layui.table,$ = layui.jquery,form = layui.form;
56 var tableIn = table.render({ 68 var tableIn = table.render({
57 elem: '#list', 69 elem: '#list',
58 url: '{:url("messagelist")}', 70 url: '{:url("messagelist")}',
@@ -72,7 +84,15 @@ @@ -72,7 +84,15 @@
72 ]] 84 ]]
73 ,id: 'testReload' 85 ,id: 'testReload'
74 ,page: true 86 ,page: true
75 - ,limit:15 87 + ,limit:10
  88 + });
  89 +
  90 + //单选按钮显示隐藏
  91 + form.on('select(patt)', function(data){
  92 + if(data.value == 1)
  93 + $("#role_").show();
  94 + else
  95 + $("#role_").hide();
76 }); 96 });
77 97
78 //头工具栏事件 98 //头工具栏事件
@@ -132,13 +152,14 @@ @@ -132,13 +152,14 @@
132 }); 152 });
133 role = arr.join(",");//将数组合并成字符串 153 role = arr.join(",");//将数组合并成字符串
134 var user_groups = $('#user_groups').val(); 154 var user_groups = $('#user_groups').val();
135 - tableIn.reload({ page: {page: 1},where: {key: key,channel: $('#channel').val(),user_groups: user_groups,role: role}}); 155 + tableIn.reload({ page: {page: 1},where: {patt: $('#patt').val(),key: key,channel: $('#channel').val(),user_groups: user_groups,role: role}});
136 }); 156 });
137 157
138 var $ = layui.$, active = { 158 var $ = layui.$, active = {
139 reload: function(){ 159 reload: function(){
140 var key = $('#key'); 160 var key = $('#key');
141 var channel = $('#channel'); 161 var channel = $('#channel');
  162 + var patt = $('#patt');
142 var user_groups = $('#user_groups'); 163 var user_groups = $('#user_groups');
143 var arr = new Array(); 164 var arr = new Array();
144 $.each($('input:checkbox:checked'),function(i){ 165 $.each($('input:checkbox:checked'),function(i){
@@ -154,6 +175,7 @@ @@ -154,6 +175,7 @@
154 key: { 175 key: {
155 id: key.val(), 176 id: key.val(),
156 channel: channel.val(), 177 channel: channel.val(),
  178 + patt: patt.val(),
157 role:role, 179 role:role,
158 user_groups: user_groups.val(), 180 user_groups: user_groups.val(),
159 } 181 }