protected function init() { $local_db = new lhh_db(); $re = $local_db->select('dbd_list', '*', array('ORDER' => 'time DESC', 'LIMIT' => [0, 1])); if (empty($re)) { echo ''; } else { echo json_encode($re[0]); } }
protected function init() { // date_default_timezone_set('PRC'); $local_db = new lhh_db(); $list = $local_db->select('lhh_comment', '*', array('lhh_id' => $_POST['id'])); if (empty($list)) { echo 'none'; } else { echo json_encode($list); } }
protected function init() { $id = $_POST['id']; $index = $_POST['index']; $type = $_POST['type']; $local_db = new lhh_db(); if ($type == 'rank') { $re = $local_db->select('dbd_comment', '*', array('dbd_id' => $id, 'ORDER' => ['up DESC', 'time ASC'], 'LIMIT' => [0, 5])); if (!empty($re)) { echo json_encode($re); } else { echo 'error'; } } else { $re = $local_db->select('dbd_comment', '*', array('dbd_id' => $id, 'ORDER' => 'time DESC', 'LIMIT' => [$index * $this->page_size, $this->page_size])); if (!empty($re)) { echo json_encode($re); } else { echo 'error'; } } }