_xcdyld($arg_array); } else { $this->_index(); } } private function _index(){ echo "!!!!!!!!!!!!"; } /** * 许昌仓打印超过24小时的漏单 */ private function _xcdyld($arg_array){ if(isset($_SESSION['api'])) { $user = $this->user->get_api($_SESSION['api']); $owner_shop = explode('|',trim($user['shop'],'|')); } if($this->input->method() == 'post'){ $params = $this->input->post(NULL,true); $time =time() - 24 * 60 * 60; $start_time = time() - 5 * 24 * 60 * 60 ; $table_name = $params['table_name']; $waybill = $this->input->post('waybill',true); $number = $this->input->post('number',true); $orderinfo = $this->input->post('orderinfo',true); $shop = $this->input->post('shop',true); $page = $this->input->post('page',true); $perpage = $this->input->post('perpage',true); $this->db->select("f.state,f.shop,f.dtime,f.number,f.printtime,f.print,f.library,f.type"); $this->db->from($table_name . " as f"); if($waybill){ $this->db->where('f.waybill',$waybill); } if($number){ $this->db->where('f.number',$number); } if($orderinfo){ $this->db->where('f.orderinfo',$orderinfo); } if($shop){ $this->db->where('f.shop',$shop); }else{ if(!empty($owner_shop)){ $this->db->where_in('f.shop',$owner_shop); } } $this->db->where(' f.type','13'); $this->db->where(' f.state','207'); $this->db->where(' f.print','3'); $this->db->where(' f.printtime >= ', $start_time ); $this->db->where(' f.printtime < ', $time ); $this->db->where(' f.library','1'); $this->db->where(" NOT EXISTS ( SELECT 1 FROM crowd_systemtransfer as s where s.number = f.number )", null, false); $this->db->order_by('f.printtime','desc'); $list = $this->db->get()->result_array(); if(empty($list)){ $rows = array('total'=>0,'over'=>0,'pagenum'=>$page,'rows'=>([])); }else{ $total = count($list); $split_arr = array_chunk($list,$perpage); $split_total = count($split_arr); $over = $split_total - $page; $r_list = $split_arr[$page-1]; $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$page,'rows'=>($r_list)); } echo json_encode($rows);exit; }else{ $table_name = $arg_array[0]; $this->data['table_name'] = $table_name; $this->_Template('zshitj_xcdyld', $this->data); } } }