首页 手机话费充值 手机话费充值示例代码 查询话费订单列表[PHP]

查询话费订单列表示例代码[PHP]

作者: 阅读数:2235 上传时间:2016-03-10

查询话费订单列表

<?php

require 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$pagenum = 1;//当前页
$pagesize = 20;//每页数量,最大20
$url = "https://api.jisuapi.com/mobilerecharge/orderlist?appkey=$appkey&pagenum=$pagenum&pagesize=$pagesize";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['total'].' '.$result['pagesize'].' '.$result['pagenum'].'
'; foreach($result['list'] as $val) { echo $val['orderno'].' '.$val['outorderno'].'
'; echo $val['account'].' '.$val['num'].'
'; echo $val['status'].' '.$val['rechargestatus'].'
'; echo $val['amount'].' '.$val['totalfee'].'
'; echo $val['addtime'].' '.$val['name'].'
'; echo $val['areaid'].' '.$val['company'].'
'; }