DeleteController.class.php 883 Bytes
<?php
/**
 * DeleteController.class.php
 * 删除我的评论
 * User: heyuelong
 * Date:2017年4月26日18:07:37
 */

namespace Api\Controller\Comment;

use Common\Common\DataCenter;
use Common\Service\CircleService;

class DeleteController extends \Api\Controller\AbstractController
{

    /**
     * 主方法
     * @return boolean
     */
    public function Index_get()
    {
        // 实例化同事圈表
        $service = new CircleService();

        // 删除我的评论
        if (!$service->del_comment(I('get.cid'), $this->uid)) {

            return false;
        }

        // 数据中心:删除评论时删除点赞记录
        $datacenter = &DataCenter::instance();
        $datacenter->delLike(I('get.cid'));

        // 数据中心:删除评论埋点
        $datacenter->delUserComment($this->uid,I('get.cid'));

        $this->_result = [];
    }
}