|
|
@@ -8,6 +8,8 @@ class Zshitj extends Start_Controller
|
|
|
public function __construct()
|
|
|
{
|
|
|
parent::__construct();
|
|
|
+ $this->load->_model('Model_shop', 'shop');
|
|
|
+ $this->load->_model("Model_express","express");
|
|
|
}
|
|
|
//定义方法的调用规则 获取URI第二段值
|
|
|
public function _remap($arg, $arg_array)
|
|
|
@@ -52,7 +54,7 @@ class Zshitj extends Start_Controller
|
|
|
$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->select("f.id,f.number,f.shop,f.state,f.express,f.waybill,f.printtime,f.print,f.library,f.type");
|
|
|
$this->db->from($table_name . " as f");
|
|
|
|
|
|
if($waybill){
|
|
|
@@ -85,11 +87,28 @@ class Zshitj extends Start_Controller
|
|
|
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];
|
|
|
+ $shop_list = $this->shop->find_all("1 = 1","id,shopname");
|
|
|
+ $shop_list = array_column($shop_list,'shopname','id');
|
|
|
+
|
|
|
+ $express_list = $this->express->find_all("1 = 1","id,title");
|
|
|
+ $express_list = array_column($express_list,'title','id');
|
|
|
+
|
|
|
+ $f_list = [];
|
|
|
+ foreach ($r_list as $key => $value) {
|
|
|
+ $f_list[$key]['id'] = $value['id'];
|
|
|
+ $f_list[$key]['number'] = $value['number'];
|
|
|
+ $f_list[$key]['shop'] = isset($shop_list[$value['shop']])?$shop_list[$value['shop']]:"";
|
|
|
+ $f_list[$key]['express'] = isset($express_list[$value['express']])? $express_list[$value['express']]:"";
|
|
|
+ $f_list[$key]['waybill'] = $value['waybill'];
|
|
|
+ $f_list[$key]['printtime'] = date('Y-m-d H:i:s',$value['printtime']);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$rows = array('total'=>$total,'over'=>$over,'pagenum'=>$page,'rows'=>($r_list));
|
|
|
}
|