RankListController.class.php
931 Bytes
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
<?php
/**
* 考试排名列表定时回调
*/
namespace Frontend\Controller\Callback;
use Think\Log;
class RankListController extends AbstractController
{
public function Index()
{
// 获取需要发送的试卷id
$back = $this->callBackData;
$ep_id = $back['ep_id'] ? $back['ep_id'] : I('get.ep_id');
Log::record('=========进入考试排名回调=======试卷ID:' . $ep_id);
// 非空判断
if (empty($ep_id)) {
return true;
}
$url = oaUrl('/Frontend/Callback/RankListCache/Index?ep_id=' . $ep_id);
Log::record('=========回调异步执行地址=======url:' . $url);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);
return true;
}
}