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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// 获取志愿者活动列表
require_once ("../user_include.inc");
ErrorLogger::doOutput("Compass...ajax_get_socia_event_detail.php....Start.", 0);
//获取参数
$unionId = ParamUtil::getRequestString("unionId");
$eventId = ParamUtil::getRequestNumber("eventId", 0);
$result = array();
//参数检查
if(empty($unionId)) {
$result["message"] = "参数错误!";
responseNG($result);
}
//判断用户是否存在
$param = array();
$param['unionid'] = $unionId;
$param['delete_flg'] = false;
$userList = UserMst::getList($param,'id','desc', 0, 1);
if(empty($userList)) {
$result["message"] = "用户不存在!";
responseNG($result);
}
//查询社会实践活动是否存在
$sociaEventDat = SocialEventDat::getById($eventId);
if(empty($sociaEventDat)) {
$result["message"] = "参数错误!";
responseNG($result);
}
$sociaEventDat->publish_time = substr($sociaEventDat->publish_time,0,10);
//todo 改为从家校系统数据库获取数据,格式一致!!
//todo 获取已完成和未完成人员名单
$finishUserList = array();
$finishUserList[] = array("name"=>"家校用户1", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$finishUserList[] = array("name"=>"家校用户2", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$unfinishUserList = array();
$unfinishUserList[] = array("name"=>"家校用户3", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
$unfinishUserList[] = array("name"=>"家校用户4", "head_img"=>"http://zgzyz.cyol.com/tplimg/25049.files/zt_ewm2.gif");
//组装返回数据
$result["sociaEventDat"] = $sociaEventDat;
$result["finishUserList"] = $finishUserList;
$result["unfinishUserList"] = $unfinishUserList;
ErrorLogger::doOutput("Compass...ajax_get_socia_event_detail.php....End.", 0);
//返回结果
responseOK($result);
function responseNG($result) {
$result = array("status"=>"NG", "result"=>$result);
print json_encode($result);
exit;
}
function responseOK($result) {
$result = array("status"=>"OK", "result"=>$result);
print json_encode($result);
exit;
}
?>