Pārlūkot izejas kodu

上传全部平台合并单

lvhao 2 dienas atpakaļ
vecāks
revīzija
f2850c8427

+ 25 - 0
core/CoreApp/controllers/Fullorderamz.php

@@ -2952,6 +2952,31 @@ class Fullorderamz extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'缺少可合并单!','success'=>false));exit;
 			}
+
+			
+			$tmp_list = $this->db->from('fullorderamz')->where_in('id',$id_arr)->select('id,orderinfo,number,type,express')->get()->result_array();
+			$count_warehouse_list = [];
+			$count_express_list = [];
+			$flag =  0;
+			$flag_str = '';
+			foreach ($tmp_list as $k => $v) {
+				$count_warehouse_list[$v['type']] = $v['type'];
+				if(empty($v['express'])){
+					$flag = 1;
+					$flag_str.= $v['number'].'仓库未选,请先选快递;';
+				}
+				$count_express_list[$v['express']] = $v['express'];
+			}
+			if($flag == 1){
+				echo json_encode(array('msg'=>$flag_str,'success'=>false));exit;
+			}
+			if(count($count_warehouse_list) > 1){
+				echo json_encode(array('msg'=>'合并单的仓库不一致,无法合并!','success'=>false));exit;
+			}
+			if(count($count_express_list) > 1){
+				echo json_encode(array('msg'=>'合并单的快递不一致,无法合并!','success'=>false));exit;
+			}
+
 			$post = array();
 			$u = $this->fullorderamz->read($id_arr[0]);
 			unset($id_arr[0]);

+ 25 - 0
core/CoreApp/controllers/Fullordersmt.php

@@ -2386,6 +2386,31 @@ class Fullordersmt extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'缺少可合并单!','success'=>false));exit;
 			}
+
+
+			$tmp_list = $this->db->from('fullordersmt')->where_in('id',$id_arr)->select('id,orderinfo,number,type,express')->get()->result_array();
+			$count_warehouse_list = [];
+			$count_express_list = [];
+			$flag =  0;
+			$flag_str = '';
+			foreach ($tmp_list as $k => $v) {
+				$count_warehouse_list[$v['type']] = $v['type'];
+				if(empty($v['express'])){
+					$flag = 1;
+					$flag_str.= $v['number'].'仓库未选,请先选快递;';
+				}
+				$count_express_list[$v['express']] = $v['express'];
+			}
+			if($flag == 1){
+				echo json_encode(array('msg'=>$flag_str,'success'=>false));exit;
+			}
+			if(count($count_warehouse_list) > 1){
+				echo json_encode(array('msg'=>'合并单的仓库不一致,无法合并!','success'=>false));exit;
+			}
+			if(count($count_express_list) > 1){
+				echo json_encode(array('msg'=>'合并单的快递不一致,无法合并!','success'=>false));exit;
+			}
+
 			$post = array();
 			$u = $this->fullordersmt->read($id_arr[0]);
 			unset($id_arr[0]);

+ 25 - 0
core/CoreApp/controllers/Fullordertt.php

@@ -2960,6 +2960,31 @@ class Fullordertt extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'缺少可合并单!','success'=>false));exit;
 			}
+
+
+			$tmp_list = $this->db->from('fullordertt')->where_in('id',$id_arr)->select('id,orderinfo,number,type,express')->get()->result_array();
+			$count_warehouse_list = [];
+			$count_express_list = [];
+			$flag =  0;
+			$flag_str = '';
+			foreach ($tmp_list as $k => $v) {
+				$count_warehouse_list[$v['type']] = $v['type'];
+				if(empty($v['express'])){
+					$flag = 1;
+					$flag_str.= $v['number'].'仓库未选,请先选快递;';
+				}
+				$count_express_list[$v['express']] = $v['express'];
+			}
+			if($flag == 1){
+				echo json_encode(array('msg'=>$flag_str,'success'=>false));exit;
+			}
+			if(count($count_warehouse_list) > 1){
+				echo json_encode(array('msg'=>'合并单的仓库不一致,无法合并!','success'=>false));exit;
+			}
+			if(count($count_express_list) > 1){
+				echo json_encode(array('msg'=>'合并单的快递不一致,无法合并!','success'=>false));exit;
+			}
+
 			$post = array();
 			$u = $this->fullordertt->read($id_arr[0]);
 			unset($id_arr[0]);