-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyrsc.php
More file actions
56 lines (45 loc) · 1.39 KB
/
myrsc.php
File metadata and controls
56 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* 根据资源类型和ID获取单个资源的协议
*
* $type : 资源类型
* $id : 资源ID
*/
require_once 'lib/WriteLog.lib.php';
require_once 'public/public.php';
require_once 'public/check.php';
if(checkVersion($_GET)){
$bRet = checkTKT($_POST);
if(!$bRet){
echo get_rsp_result(false, 'check token fail');
exit();
}
}
try{
$nCoolType = (int)(isset($_GET['type'])?$_GET['type']:0); //cooltype:主题、壁纸、铃声、字体等分类
$strCyid = isset($_GET['cyid'])?$_GET['cyid']:'';
$nPage = (int)(isset($_GET['page'])?$_GET['page']:0);
$nNum = (int)(isset($_GET['num'])?$_GET['num']:0);
$nStart = $nPage * $nNum;
require_once 'tasks/Exorder/ExorderRecordDb.class.php';
$erDb = new ExorderRecordDb();
$rows = $erDb->getChargeRecord($strCyid, $nCoolType, $nStart, $nNum);
if($rows === false){
Log::write('myrsc getChargeRecord() failed', 'log');
echo get_rsp_result(false, 'get charge record failed');
exit();
}
require_once 'tasks/protocol/MyResProtocol.php';
$arrProtocol = array();
foreach ($rows as $row){
$myRes = new MyResProtocol();
$myRes->setProtocol($row);
array_push($arrProtocol, $myRes);
}
$arrResult = array('result'=>true,
'list'=>$arrProtocol);
echo json_encode($arrResult);
}catch(Exception $e){
Log::write('myrsc exception', 'log');
echo get_rsp_result(false, 'myrsc exception');
}