コード例 #1
0
ファイル: events_model.php プロジェクト: huayuxian/FUEL-CMS
 public function list_items($limit = null, $offset = null, $col = 'start_date', $order = 'desc', $just_count = FALSE)
 {
     $this->db->select('events.id, events.name, start_date, end_date, events.published', FALSE);
     $data = parent::list_items($limit, $offset, $col, $order, $just_count);
     if (!$just_count) {
         foreach ($data as $key => $val) {
             $data[$key]['start_date'] = date_formatter($val['start_date'], 'm/d/Y g:ia');
             $data[$key]['end_date'] = date_formatter($val['start_date'], 'm/d/Y g:ia');
         }
     }
     return $data;
 }
コード例 #2
0
ファイル: news_model.php プロジェクト: scotton34/sample
 public function list_items($limit = null, $offset = null, $col = 'name', $order = 'asc', $just_count = FALSE)
 {
     $this->db->select('news.id, news.title, news.publish_date, news.published', FALSE);
     $data = parent::list_items($limit, $offset, $col, $order);
     if (!$just_count) {
         foreach ($data as $key => $val) {
             // format with PHP instead of MySQL so that ordering will still work with MySQL
             if (!empty($val['publish_date'])) {
                 $data[$key]['publish_date'] = date_formatter($val['publish_date'], 'm/d/Y h:ia');
             }
         }
     }
     return $data;
 }