-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,368 additions
and
1,311 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
<?php | ||
|
||
$res = array( | ||
'me' => array('id'=>1, 'image'=>'./image/user/1.jpg', 'name'=>'kink'), | ||
'rosters' => array( | ||
array('id'=>2, 'image'=>'./image/user/2.jpg', 'name'=>'用户2'), | ||
array('id'=>3, 'image'=>'./image/user/3.jpg', 'name'=>'用户3'), | ||
array('id'=>4, 'image'=>'./image/user/4.jpg', 'name'=>'用户4'), | ||
array('id'=>5, 'image'=>'./image/user/5.jpg', 'name'=>'用户5'), | ||
array('id'=>6, 'image'=>'./image/user/6.jpg', 'name'=>'用户6'), | ||
array('id'=>7, 'image'=>'./image/user/7.jpg', 'name'=>'用户7'), | ||
array('id'=>8, 'image'=>'./image/user/8.jpg', 'name'=>'用户8'), | ||
array('id'=>9, 'image'=>'./image/user/9.jpg', 'name'=>'用户9') | ||
) | ||
$id = empty($_GET['id']) ? 1 : $_GET['id']; | ||
|
||
$rosters = array( | ||
'1' => array('id'=>1, 'image'=>'./image/user/1.jpg', 'name'=>'艾伦', 'watch'=>'2,3,4,5,6,7,8,9'), | ||
'2' => array('id'=>2, 'image'=>'./image/user/2.jpg', 'name'=>'毕维斯', 'watch'=>'1,4,7,8'), | ||
'3' => array('id'=>3, 'image'=>'./image/user/3.jpg', 'name'=>'拜伦', 'watch'=>'1,2,6,5'), | ||
'4' => array('id'=>4, 'image'=>'./image/user/4.jpg', 'name'=>'道格拉斯', 'watch'=>'7,8,9'), | ||
'5' => array('id'=>5, 'image'=>'./image/user/5.jpg', 'name'=>'爱德华', 'watch'=>'4,6,8,9'), | ||
'6' => array('id'=>6, 'image'=>'./image/user/6.jpg', 'name'=>'加布力尔', 'watch'=>'1,3,5,7,9'), | ||
'7' => array('id'=>7, 'image'=>'./image/user/7.jpg', 'name'=>'雨果', 'watch'=>'2,4,5,8'), | ||
'8' => array('id'=>8, 'image'=>'./image/user/8.jpg', 'name'=>'里斯特', 'watch'=>'1,4,6,7,9'), | ||
'9' => array('id'=>9, 'image'=>'./image/user/9.jpg', 'name'=>'玛希', 'watch'=>'2,3,4,5,6,7,8') | ||
); | ||
|
||
echo json_encode($res); | ||
|
||
$len = $id; | ||
|
||
$res = array(); | ||
$res['me'] = $rosters[$id]; | ||
|
||
$ids = explode(',', $rosters[$id]['watch']); | ||
foreach( $ids as $k=>$v ) { | ||
$res['rosters'][] = $rosters[$v]; | ||
} | ||
|
||
echo json_encode($res); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters