commit | author | age
|
e2b48d
|
1 |
<?php |
B |
2 |
|
|
3 |
/** |
|
4 |
* 我的红包列表 |
|
5 |
*/ |
|
6 |
define('IN_ECS', true); |
|
7 |
require('includes/init.php'); |
|
8 |
$page=$_GET['page']*5; |
|
9 |
$uid = isset($_REQUEST['uid']) ? intval($_REQUEST['uid']) : 0; |
|
10 |
$result=array(); |
|
11 |
$sql="SELECT ub.used_time,ub.bonus_sn ,bt.type_name,bt.type_money,bt.min_goods_amount,bt.use_end_date |
|
12 |
FROM ".$ecs->table('user_bonus')." AS ub,".$ecs->table('bonus_type')." AS bt WHERE ub.user_id='$uid' AND ub.bonus_type_id=bt.type_id |
|
13 |
LIMIT $page,5"; |
|
14 |
//print_r($sql); |
|
15 |
$result= $db -> getAll($sql); |
|
16 |
$length=count($result); |
|
17 |
for($i=0;$i<$length;$i++){ |
|
18 |
if($result[$i]['used_time']==0){ |
|
19 |
$result[$i]['is_used']="未使用"; |
|
20 |
}else{ |
|
21 |
$result[$i]['is_used']="已使用"; |
|
22 |
} |
|
23 |
if($result[$i]['bonus_sn']==0){ |
|
24 |
$result[$i]['bonus_sn']="N/A"; |
|
25 |
} |
|
26 |
$result[$i]['use_end_date']=date("Y-m-d",$result[$i]['use_end_date']); |
|
27 |
} |
|
28 |
print_r(json_encode($result)); |
|
29 |
|
|
30 |
?> |