Пример #1
0
 public function programTemplateSetDetail()
 {
     $intChannelId = intval($this->input['channelId']);
     if (!$intChannelId) {
         $this->errorOutput('NO CHANNELID');
     }
     //如果没有起始时间 和结束时间  则1-1 到12-31
     $this->input['startTime'] = $this->input['startTime'] ? $this->input['startTime'] : date('Y') . '-1-1';
     $this->input['endTime'] = $this->input['endTime'] ? $this->input['endTime'] : date('Y') + 1 . '-12-31';
     $intStartTime = intval(date('Ymd', strtotime($this->input['startTime'])));
     $intEndTime = intval(date('Ymd', strtotime($this->input['endTime'])));
     $condition = ' AND channel_id = ' . $intChannelId;
     $condition .= ' AND intdate >= ' . $intStartTime;
     $condition .= ' AND intdate <= ' . $intEndTime;
     if (!class_exists('programTemplate')) {
         include CUR_CONF_PATH . 'lib/program_template.class.php';
     }
     $objProTemplate = new programTemplate();
     $relation = $objProTemplate->getProTemRelation($condition);
     $condition = '';
     $arTemplateList = $objProTemplate->getList($condition, 'id, title');
     $ret = array('relation' => $relation, 'templateList' => $arTemplateList);
     $this->addItem($ret);
     $this->output();
 }
Пример #2
0
 public function show()
 {
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $count = $this->input['count'] ? intval($this->input['count']) : 20;
     $limit = ' LIMIT ' . $offset . ', ' . $count;
     $condition = $this->get_condition();
     if (!class_exists('programTemplate')) {
         include CUR_CONF_PATH . 'lib/program_template.class.php';
     }
     $objProTemplate = new programTemplate();
     $fields = 'id, title,indexpic, create_time, update_time, create_userid, create_username, edit_userid, edit_username';
     $ret = $objProTemplate->getList($condition . $limit, $fields);
     if (is_array($ret) && count($ret) > 0) {
         foreach ($ret as $k => $v) {
             $this->addItem($v);
         }
     }
     $this->output();
 }