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); // } // } } ?>