load->library('session'); $this->load->_model('Model_colour','colour'); $this->load->_model('Model_shop','shop'); $this->load->_model('Model_warehouse','warehouse'); $this->load->_model('Model_fullorder','fullorder'); $this->load->_model('Model_fullordertt','fullordertt'); $this->load->_model('Model_fullordersmt','fullordersmt'); $this->load->_model("Model_logic_order","logic_order"); //getInfo } //定义方法的调用规则 获取URI第二段值 public function _remap($arg,$arg_array) { if($arg == 'add') { $this->_add(); } else if($arg == 'edit') { $this->_edit($arg_array); } else if($arg == 'see') { $this->_see($arg_array); } else if($arg == 'seeindex') { $this->_seeindex(); } else if($arg == 'seephone') { $this->_seephone(); } else if($arg == 'del') { $this->_del(); } else if($arg == 'seebynumber'){ $this->_seebynumber($arg_array); } else { $this->_index(); } } public function _index() { if(isset($_SESSION['api'])) { $user = $this->user->get_api($_SESSION['api']); $usp = $user; $fgshop = "";$sid = ""; $usersp = explode('|',trim($user['shop'],'|')); foreach ($usersp as $value) { $fgshop .= " shop = ".$value." or"; $sid .= " id = ".$value." or"; } $fgshop .= " shop = '0' or"; } $post = $this->input->post(NULL, TRUE); if(isset($post['page'])) { $page = $this->input->post('page',true); $perpage = $this->input->post('perpage',true); $number = $this->input->post('number',true); $shop = $this->input->post('shop',true); $warehouse = $this->input->post('warehouse',true); $timetk = $this->input->post('timetk',true); $timetj = $this->input->post('timetj',true); $timetk = strtotime($timetk); $timetj = strtotime($timetj); $where = "(".rtrim($fgshop,'or').")"; if($number) { $where .= " and number like '%$number%'"; } if($shop) { $where .= " and shop = '$shop'"; } if($warehouse) { $where .= " and warehouse = '$warehouse'"; } if($timetk && $timetj) { $where .= " and time > '$timetk' and time < '$timetj'"; } //数据排序 $order_str = "id desc"; if(empty($page)) { $start = 0; $perpage = 1; } else { $start = ($page - 1)*$perpage; } $info_list = $this->colour->find_all($where,'id,number,shop,warehouse,time,img,img_two',$order_str,$start,$perpage); foreach ($info_list as $key=>$value) { $info_list[$key]['time'] = date('Y-m-d H:i:s',$value['time']); if($value['shop'] == '0') { $info_list[$key]['shop'] = '常用色'; } else { $shop = $this->shop->read($value['shop']); $info_list[$key]['shop'] = $shop['shopname']; } $warehouse = $this->warehouse->read($value['warehouse']); $info_list[$key]['warehouse'] = $warehouse['title']; $colorimg = explode('|',$value['img']); $v = $colorimg[0]; $lx = explode(".",$v); $lx = strtolower(end($lx)); if($lx == "3gp" || $lx == "rmvb" || $lx == "flv" || $lx == "wmv" || $lx == "avi" || $lx == "mkv" || $lx == "wav" || $lx == "mp4") { $info_list[$key]['img'] = '