Commit 06b8783ab8dfd9328b2a67c7c1b7e2edd1403e78

Authored by zhangximing
1 parent 45bfe4aa

短信充值流水查询

@@ -1286,4 +1286,69 @@ class Seller extends Common @@ -1286,4 +1286,69 @@ class Seller extends Common
1286 } 1286 }
1287 return view(); 1287 return view();
1288 } 1288 }
  1289 +
  1290 + /**
  1291 + * 商家短信充值查询
  1292 + */
  1293 + public function getsellersmslist(){
  1294 +
  1295 + if(Request::isAjax()){
  1296 + $data = Request::except('file');
  1297 +
  1298 + $time = (isset($data['time']) && !empty($data['time'])) ? explode(' - ',$data['time']) : (strtotime(date("Y-m-d 00:00:00")).'-'.strtotime(date("Y-m-d 23:59:59")));
  1299 +
  1300 + $newtime = is_array($time) ? (strtotime(date($time[0])).'-'.strtotime(date($time[1]))) : $time;
  1301 +
  1302 + $channel = (!isset($data['time'])) ? 1 : $data['channel'];
  1303 +
  1304 + $name = (!isset($data['time'])) ? '' : $data['key'];
  1305 +
  1306 + $url= ON_LINE.'App.Seller.QuerySelllerSmsList&offset='.$data['page'].'&size='.$data['limit'].'&time='.$newtime.'&channel='.$channel.'&name='.$name;
  1307 +
  1308 + $list = $this->curl_get($url);
  1309 +
  1310 + $array = json_decode($list,TRUE);
  1311 +
  1312 + if($array){
  1313 + foreach ($array['data']['list'] as $key => $value) {
  1314 + $array['data']['list'][$key]['bdate'] = date("Y年m月d日 H时i分s秒",$value['bdate']);
  1315 + $array['data']['list'][$key]['paystatus'] = $value['paystatus']==1 ? '成功' : '失败';
  1316 + $array['data']['list'][$key]['channel'] = $value['channel']==NULL ? '小程序' : $value['channel'];
  1317 + $array['data']['list'][$key]['package_name'] = $value['package_name']=='other' ? '其他' : $value['package_name'];
  1318 + }
  1319 + return $result = [
  1320 + 'code'=>0,'msg'=>'获取成功!',
  1321 + 'data'=>$array['data']['list'],
  1322 + 'count'=>$array['data']['total'],
  1323 + 'rel'=>1
  1324 + ];
  1325 +
  1326 + }else{
  1327 + $result['code'] = 0;
  1328 + $result['msg'] = '请求错误!';
  1329 + }
  1330 + return $result;
  1331 + }
  1332 + $this->assign ( 'title','商家短信日志查询');
  1333 + return view();
  1334 + }
  1335 +
  1336 + /**
  1337 + * post
  1338 + */
  1339 + public function curl_get($url)
  1340 + {
  1341 +
  1342 + $info = curl_init();
  1343 + curl_setopt($info,CURLOPT_RETURNTRANSFER,true);
  1344 + curl_setopt($info,CURLOPT_HEADER,0);
  1345 + curl_setopt($info,CURLOPT_NOBODY,0);
  1346 + curl_setopt($info,CURLOPT_SSL_VERIFYPEER,false);
  1347 + curl_setopt($info,CURLOPT_SSL_VERIFYPEER,false);
  1348 + curl_setopt($info,CURLOPT_SSL_VERIFYHOST,false);
  1349 + curl_setopt($info,CURLOPT_URL,$url);
  1350 + $output = curl_exec($info);
  1351 + curl_close($info);
  1352 + return $output;
  1353 + }
1289 } 1354 }
  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>{:$title}</legend>
  5 + </fieldset>
  6 + <div class="demoTable">
  7 + 商家:
  8 + <div class="layui-input-inline">
  9 + <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}店铺名称" autocomplete="off">
  10 + </div>
  11 + 日期范围:
  12 + <div class="layui-input-inline" >
  13 + <input type="text" style = "width:300px"; class="layui-input" id="time" placeholder="默认为当天的充值情况">
  14 + </div>
  15 + 商家来源:
  16 + <div class="layui-input-inline layui-form">
  17 + <div class="layui-input-8">
  18 + <select name="class" id="channel" lay-filter="myselect">
  19 + <option value="-1">全部</option>
  20 + <option value="1" selected>合作</option>
  21 + <option value="2">推广</option>
  22 + <option value="3">测试</option>
  23 + </select>
  24 + </div>
  25 + </div>
  26 +
  27 + <button class="layui-btn" id="search" data-type="reload">查询统计</button>
  28 + </div>
  29 + <table class="layui-table" id="list" lay-filter="list"></table>
  30 +</div>
  31 +<script type="text/html" id="toolbarDemo">
  32 +</script>
  33 +{include file="common/foot"/}
  34 +<script>
  35 + layui.use(['table','form','laydate'], function() {
  36 + var table = layui.table,laydate = layui.laydate,$ = layui.jquery;
  37 + console.log(layui);
  38 + var tableIn = table.render({
  39 + elem: '#list',
  40 + url: '{:url("getsellersmslist")}',
  41 + method: 'post',
  42 + title: '短信充值流水',
  43 + page:true,
  44 + toolbar: '#toolbarDemo',
  45 + cols: [[
  46 + {field: 'id', title: '{:lang("id")}',width:70, fixed: true},
  47 + {field: 'sellername', align: 'center',title: '店铺名字'},
  48 + {field: 'package_name', title: '套餐'},
  49 + {field: 'total', title: '充值总数'},
  50 + {field: 'price', title: '金额'},
  51 + {field: 'channel', align: 'center', title: '充值渠道'},
  52 + {field: 'desc', align: 'center', title: '充值备注'},
  53 + {field: 'paystatus', align: 'center',title: '充值状态'},
  54 + {field: 'bdate', align: 'center',title: '购买时间', sort: true},
  55 + {field: 'cdate', align: 'center',title: '记录时间', sort: true},
  56 + ]],
  57 + done: function(res, curr, count){
  58 +
  59 + }
  60 + ,id: 'testReload'
  61 + ,page: true
  62 + ,limit:10
  63 + });
  64 +
  65 + //日期时间范围
  66 + laydate.render({
  67 + elem: '#time'
  68 + ,type: 'datetime'
  69 + ,range: true
  70 + });
  71 +
  72 + //搜索
  73 + $('#search').on('click', function() {
  74 + //关键字
  75 + var key = $('#key').val();
  76 +
  77 + var time = $('#time').val();
  78 + console.log(time);
  79 + //商家来源
  80 + var channel = $('#channel').val();
  81 + console.log(channel);
  82 +
  83 + //传参
  84 + tableIn.reload({ page: {page: 1},where: {key: key,time: time,channel: channel}});
  85 + });
  86 +
  87 + var $ = layui.$, active = {
  88 + reload: function(){
  89 + var key = $('#key');
  90 + //执行重载
  91 + table.reload('testReload', {
  92 + page: {
  93 + curr: 1 //重新从第 1 页开始
  94 + }
  95 + ,where: {
  96 + key: {
  97 + id: key.val()
  98 + }
  99 + }
  100 + });
  101 + }
  102 + };
  103 + })
  104 +</script>