|
@@ -15,6 +15,7 @@ class Whlabelfz1 extends Start_Controller
|
|
|
$this->load->_model('Model_whlabel_type', 'whlabel_type');
|
|
|
$this->load->_model("Model_shop","shop");
|
|
|
$this->load->_model("Model_warehouse","warehouse");
|
|
|
+ $this->load->_model("Model_whlabeltransport","whlabeltransport");
|
|
|
}
|
|
|
//定义方法的调用规则 获取URI第二段值
|
|
|
public function _remap($arg, $arg_array)
|
|
@@ -286,7 +287,7 @@ class Whlabelfz1 extends Start_Controller
|
|
|
} else {
|
|
|
$start = ($page - 1) * $perpage;
|
|
|
}
|
|
|
- $get_model = $this->db->from("whlabel")->where($where_sql)->select("id,number,purchase,sku,warehouse,title,details,cpid,COUNT(id) AS total_num")->group_by('sku');
|
|
|
+ $get_model = $this->db->from("whlabel")->where($where_sql)->select("id,number,purchase,sku,warehouse,features,title,details,cpid,COUNT(id) AS total_num")->group_by('sku');
|
|
|
if(!empty($post['dopx'])){
|
|
|
if($post['dopx'] == 1){
|
|
|
$get_model = $get_model->order_by("total_num",'ASC');
|
|
@@ -303,6 +304,11 @@ class Whlabelfz1 extends Start_Controller
|
|
|
$list = $get_model->limit($perpage,$start)->get()->result_array();
|
|
|
$warehouse_info = $this->warehouse->read($warehouse);
|
|
|
$final_list = [];
|
|
|
+
|
|
|
+ $sku_list = array_column($list,'sku');
|
|
|
+
|
|
|
+
|
|
|
+ // $zd_list = ;
|
|
|
foreach($list as $k => $v){
|
|
|
$final_list[$k]['id'] = $v['id'];
|
|
|
$final_list[$k]['warehous'] = $warehouse_info['title'];
|
|
@@ -318,8 +324,17 @@ class Whlabelfz1 extends Start_Controller
|
|
|
}
|
|
|
$final_list[$k]['details'] = $tmp_deatil;
|
|
|
$final_list[$k]['total_num'] = $v['total_num'];
|
|
|
- $final_list[$k]['zt'] = "";
|
|
|
- $final_list[$k]['zd'] = "";
|
|
|
+ $zt = $this->whlabeltransport->find_all('sku = "' . $v['sku'] . '" and warehouse = "' . $v['warehouse'] . '" and features = "' . $v['features'] . '" and cz = "0"');
|
|
|
+ $ztdata = '';
|
|
|
+ if (count($zt) > 0) {
|
|
|
+ foreach ($zt as $vv) {
|
|
|
+ $ztdata .= '<p>' . $vv['num'] . ' - ' . date('Y-m-d', $vv['stime']) . '</p>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $z = $this->db->from("whlabel")->where("sku = '".$v['sku']."' and state = 0 and warehouse = '". $v['warehouse']."' and features = '". $v['features']."' and zd != '' ")->count_all_results();
|
|
|
+ $final_list[$k]['zt'] = $ztdata;
|
|
|
+ $final_list[$k]['zd'] = $z;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|