Commit 65756e05a10db018a46509b06901093c80f18ef7

Authored by teemitop
1 parent c237c9a9

商家列表

@@ -11,9 +11,10 @@ class Seller extends Common @@ -11,9 +11,10 @@ class Seller extends Common
11 public function sellerList(){ 11 public function sellerList(){
12 if(Request::isAjax()){ 12 if(Request::isAjax()){
13 $data = Request::except('file'); 13 $data = Request::except('file');
14 - $limit = '&x='.$data["page"].'&y='.$data["limit"]; 14 + $key= input('post.key') ? input('post.key') : "";
  15 + $limit = '&x='.$data["page"].'&y='.$data["limit"].'&keywords='.@$key['id'];
15 //获取运营人员列表 16 //获取运营人员列表
16 - $list= file_get_contents(ON_LINE.'App.Seller.GetSellerList'.$limit); 17 + $list= file_get_contents(UNDER_LINE.'App.Seller.GetSellerList'.$limit);
17 $array = json_decode($list,TRUE); 18 $array = json_decode($list,TRUE);
18 foreach ($array['data'][0]['data'] as $key => $value) { 19 foreach ($array['data'][0]['data'] as $key => $value) {
19 $array['data'][0]['data'][$key]['cdate'] = date("Y-m-d H:i:s",$value['cdate']); 20 $array['data'][0]['data'][$key]['cdate'] = date("Y-m-d H:i:s",$value['cdate']);
@@ -14,12 +14,21 @@ @@ -14,12 +14,21 @@
14 <i class="fa fa-file-image-o"></i> 菜品库管理 14 <i class="fa fa-file-image-o"></i> 菜品库管理
15 </a> 15 </a>
16 </blockquote> 16 </blockquote>
  17 +
  18 + <div class="demoTable">
  19 + 搜索商家:<div class="layui-inline">
  20 + <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}店铺名称" autocomplete="off">
  21 + </div>
  22 + <button class="layui-btn" id="search" data-type="reload">搜索</button>
  23 + </div>
  24 +
17 <table class="layui-table" id="list" lay-filter="list"></table> 25 <table class="layui-table" id="list" lay-filter="list"></table>
18 </div> 26 </div>
19 {include file="common/foot"/} 27 {include file="common/foot"/}
20 <script type="text/html" id="action"> 28 <script type="text/html" id="action">
21 <a class="layui-btn {{ 0==d.status?'':'layui-btn-danger'}} layui-btn-xs" lay-event="stop">{{ 0==d.status?'启用':'停用'}}</a> 29 <a class="layui-btn {{ 0==d.status?'':'layui-btn-danger'}} layui-btn-xs" lay-event="stop">{{ 0==d.status?'启用':'停用'}}</a>
22 <a href="{:url('Template/configMer')}?id={{d.id}}&name={{d.sellername}}" class="layui-btn layui-btn-xs">配置菜品</a> 30 <a href="{:url('Template/configMer')}?id={{d.id}}&name={{d.sellername}}" class="layui-btn layui-btn-xs">配置菜品</a>
  31 + <a href="{:url('Basicinfo/smsRecharge')}?id={{d.id}}&name={{d.sellername}}" class="layui-btn layui-btn-xs">线下短信充值</a>
23 </script> 32 </script>
24 <script> 33 <script>
25 layui.use(['table','form'], function() { 34 layui.use(['table','form'], function() {
@@ -35,11 +44,47 @@ @@ -35,11 +44,47 @@
35 {field: 'sellername', title: '商家名称', width: 150}, 44 {field: 'sellername', title: '商家名称', width: 150},
36 {field: 'phone', title: '商家电话', width: 150}, 45 {field: 'phone', title: '商家电话', width: 150},
37 {field: 'map_address', title: '商家地址', width: 300}, 46 {field: 'map_address', title: '商家地址', width: 300},
  47 + {field: 'last_num', align: 'center',title: '短信余量', width: 120},
38 {field: 'statusVal', align: 'center',title: '状态', width: 120}, 48 {field: 'statusVal', align: 'center',title: '状态', width: 120},
39 {field: 'user_name', align: 'center',title: '创建人', width: 120}, 49 {field: 'user_name', align: 'center',title: '创建人', width: 120},
40 {field: 'cdate', align: 'center',title: '创建日期', width: 180}, 50 {field: 'cdate', align: 'center',title: '创建日期', width: 180},
41 - {width: 200, align: 'center',title: '操作', toolbar: '#action'} 51 + {width: 230, align: 'center',title: '操作', toolbar: '#action'}
42 ]] 52 ]]
  53 + ,id: 'testReload'
  54 + ,page: true
  55 + ,height: 471
  56 + });
  57 +
  58 + //搜索
  59 + $('#search').on('click', function() {
  60 + var key = $('#key').val();
  61 + if($.trim(key)==='') {
  62 + layer.msg('{:lang("pleaseEnter")}店铺名称!',{icon:0});
  63 + return;
  64 + }
  65 + tableIn.reload({ page: {page: 1},where: {key: key}});
  66 + });
  67 +
  68 + var $ = layui.$, active = {
  69 + reload: function(){
  70 + var key = $('#key');
  71 + //执行重载
  72 + table.reload('testReload', {
  73 + page: {
  74 + curr: 1 //重新从第 1 页开始
  75 + }
  76 + ,where: {
  77 + key: {
  78 + id: key.val()
  79 + }
  80 + }
  81 + });
  82 + }
  83 + };
  84 +
  85 + $('.demoTable .layui-btn').on('click', function(){
  86 + var type = $(this).data('type');
  87 + active[type] ? active[type].call(this) : '';
43 }); 88 });
44 89
45 //启用、停用 90 //启用、停用