<?php /** * 【考试中心-手机端】考试排名点赞接口 * LikeController.class.php * @author: 蔡建华 * @date: 2017-05-23 */ namespace Api\Controller\Rank; use Common\Common\DataCenter; use Common\Service\LikeService; class LikeController extends AbstractController { public function Index_post() { // 答卷id $ea_id = I('post.ea_id'); // 实例化考试-点赞表service $like_s = New LikeService(); // 点赞 $data = $like_s->add_like_data($ea_id, $this->uid); // 操作失败,返回提示"点赞失败" if (!$data) { E('_ERR_LIKE_FALSE'); } // 数据中心:点赞埋点 $datacenter =& DataCenter::instance(); $datacenter->addLike($this->_login->user, $ea_id); // 返回结果 $this->_result = $data; } }