IndexAction::delPostDigg PHP Méthode

delPostDigg() public méthode

public delPostDigg ( )
    public function delPostDigg()
    {
        $maps['post_id'] = $map['post_id'] = intval($_POST['row_id']);
        $map['uid'] = $this->mid;
        $hasdigg = M('weiba_post')->where('post_id=' . $map['post_id'])->find();
        // $is_follow = $this->is_follow($hasdigg['weiba_id']);
        // if(!$is_follow){
        // 	echo 0;exit;
        // }
        $result = M('weiba_post_digg')->where($map)->delete();
        if ($result) {
            $post = M('weiba_post')->where($maps)->find();
            M('weiba_post')->where($maps)->setField('praise', $post['praise'] - 1);
            echo 1;
        } else {
            echo 0;
        }
    }