AdminAction::recoverPost PHP Метод

recoverPost() публичный Метод

后台还原帖子
public recoverPost ( )
    public function recoverPost()
    {
        if (empty($_POST['post_id'])) {
            $return['status'] = 0;
            $return['data'] = '';
            echo json_encode($return);
            exit;
        }
        !is_array($_POST['post_id']) && ($_POST['post_id'] = array($_POST['post_id']));
        $data['post_id'] = array('in', $_POST['post_id']);
        $res = D('weiba_post')->where($data)->setField('is_del', 0);
        if ($res) {
            $postList = D('weiba_post')->where($data)->findAll();
            foreach ($postList as $v) {
                D('weiba')->where('weiba_id=' . $v['weiba_id'])->setInc('thread_count');
            }
            $return['status'] = 1;
            $return['data'] = L('PUBLIC_ADMIN_OPRETING_SUCCESS');
        } else {
            $return['status'] = 0;
            $return['data'] = L('PUBLIC_ADMIN_OPRETING_ERROR');
        }
        echo json_encode($return);
        exit;
    }