RankListController.class.php 931 Bytes
<?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;
    }
}