OverallRatingController.class.php 941 Bytes
<?php
/**
 * 【后台】培训综合评分接口
 * OverallRatingController.class.php
 * User: caijianhua
 * Date: 2017/8/29
 * Time: 下午5:15
 */

namespace Apicp\Controller\Score;

use Common\Service\CompositeScoreService;

class OverallRatingController extends \Apicp\Controller\AbstractController
{
    /** @var  CompositeScoreService 培训综合评分表 */
    protected $composite_service;

    public function before_action($action = '')
    {
        if (!parent::before_action($action)) {
            return false;
        }
        $this->composite_service = new CompositeScoreService();
        return true;
    }


    public function Index_post()
    {
        $ed_id = I('post.ed_id');

        if (empty($ed_id)) {
            // 培训ID不能为空
            E('_EMPTY_ED_ID');
        }
        $data = $this->composite_service->overall_rating($ed_id);

        $this->_result = $data;

        return true;
    }
}