public function detail() { $id = intval($this->input['id']); if (!$id) { $this->errorOutput('NO ID'); } if (!class_exists('programLibrary')) { include CUR_CONF_PATH . 'lib/program_library.class.php'; } $objProLibrary = new programLibrary(); $ret = $objProLibrary->getOneById($id); if ($ret) { $this->addItem($ret); } $this->output(); }
public function programLibraryList() { $offset = $this->input['offset'] ? intval($this->input['offset']) : 0; $count = $this->input['count'] ? intval($this->input['count']) : 400; $limit = ' LIMIT ' . $offset . ', ' . $count; $condition = $this->get_condition(); if (!class_exists('programLibrary')) { include CUR_CONF_PATH . 'lib/program_library.class.php'; } $objProLibrary = new programLibrary(); $ret = $objProLibrary->getList($condition . $limit); if (is_array($ret) && count($ret) > 0) { $date = date('Y-m-d'); $noon = strtotime($date . ' 12:00'); foreach ($ret as $k => $v) { $ret[$k]['noon'] = strtotime($data . ' ' . $v['start_time']) >= $noon ? 1 : 0; } } if (!empty($ret)) { $this->addItem($ret); } $this->output(); }