1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- !defined('BASEPATH') && exit('No direct script access allowed');
- class Index extends MY_Main_Controller
- {
- public function __construct()
- {
- parent::__construct();
- $this->load->model('homepage_model','homepage');
- $this->load->model('web_setting_model','web_setting');
- }
- public function index()
- {
- $name = 'slider';
- $items = $this->homepage->all();
- $item = $this->web_setting->getValueByName($name);
- $data['slider'] = json_decode($item[0]['value'] , true);
- $data['items'] = $items;
- $this->load_view($data);
- }
- public function index1()
- {
- $name = 'slider';
- $items = $this->homepage->all();
- $item = $this->web_setting->getValueByName($name);
- $data['slider'] = json_decode($item[0]['value'] , true);
- $data['items'] = $items;
- $this->action_name = __FUNCTION__;
- $this->load_view($data);
- }
- // public function fuckData()
- // {
- // $this->load->model('news_model','news');
- // $json = file_get_contents('F:\\dt_article.json');
- // $json_arr = json_decode($json , true);
- // $data = $json_arr['RECORDS'];
- // foreach ($data as $key => $value) {
- // $parm['type'] = $value['type'];
- // $parm['title'] = $value['title'];
- // $parm['author'] = $value['author'] ? $value['author'] : '';
- // $parm['from'] = $value['from'] ? $value['from'] : '';
- // $parm['ord'] = $value['ord'];
- // $parm['pv'] = $value['pv'];
- // $parm['publishtime'] = strtotime($value['publishtime']);
- // $parm['addtime'] = time();
- // $parm['img'] = "http://www.usky.cn".$value['img'];
- // $parm['desc'] = $value['desc'] ? $value['desc'] : '';
- // $parm['content'] = $value['content'];
- // $this->news->insert($parm);
- // $parm = '';
- // }
- // }
- //
- // public function sortData($value='')
- // {
- // $this->load->model('news_model','news');
- // $all = $this->news->all_order_time();
- // $i = 1;
- // foreach ($all as $key => $value) {
- // $parm['ord'] = $i++;
- // $this->news->update($value['id'] , $parm);
- // }
- // }
- }
- ?>
-
|