Преглед изворни кода

修改tt的dhl 禁用申报品名

lvhao пре 4 месеци
родитељ
комит
9fa805ad0e
1 измењених фајлова са 13 додато и 4 уклоњено
  1. 13 4
      core/CoreApp/controllers/Fullordertt.php

+ 13 - 4
core/CoreApp/controllers/Fullordertt.php

@@ -42,6 +42,7 @@ class Fullordertt extends Start_Controller {
 		$this->load->_model('Model_power','power');
 		$this->load->_model('Model_fullordertthb','fullordertthb');
 		$this->load->_model('Model_returngoods','returngoods');
+		$this->load->_model("Model_logic_order","logic_order");
 	}
 	//定义方法的调用规则 获取URI第二段值
     public function _remap($arg,$arg_array)
@@ -997,10 +998,18 @@ class Fullordertt extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'此快递方式必须选择美国仓!','success'=>false));exit;
 			}
-			if($post['express'] == 42 && $post['sbpm'] != 'Human Hair Wigs' && $post['sbpm'] != 'Human Hair Goods' && $post['type'] != 34)//$post['express'] == 3 || 
-			{
-				echo json_encode(array('msg'=>'此快递方式必须选择Human Hair Wigs/Human Hair Goods!','success'=>false));exit;
+			// if($post['express'] == 42 && $post['sbpm'] != 'Human Hair Wigs' && $post['sbpm'] != 'Human Hair Goods' && $post['type'] != 34)//$post['express'] == 3 || 
+			// {
+			// 	echo json_encode(array('msg'=>'此快递方式必须选择Human Hair Wigs/Human Hair Goods!','success'=>false));exit;
+			// }
+			//减少代码复用吧
+			if($post['type'] != 34){
+				$lo_ret = $this->logic_order->checkEditExpress($post);
+				if($lo_ret['code'] != 1){
+					echo json_encode(array('msg'=>$lo_ret['msg'],'success'=>false));exit;
+				}
 			}
+			
 			if($post['express'] == 24 && $post['sbpm'] != 'Hair Sample' && $post['sbpm'] != 'Human Hair Wigs' && $post['sbpm'] != 'Human Hair Goods' && $post['type'] != 34)//$post['express'] == 3 || 
 			{
 				echo json_encode(array('msg'=>'此快递方式必须选择Hair Sample/Human Hair Wigs/Human Hair Goods!','success'=>false));exit;
@@ -1077,7 +1086,7 @@ class Fullordertt extends Start_Controller {
 			{
 				echo json_encode(array('msg'=>'此快递方地址不可超出'.$express['addresssize'].'个字符','success'=>false));exit;
 			}
-			if(strlen($post['address']) > 32 && ( $post['express'] == 16))
+			if(strlen($post['address']) > 32 && ($post['express'] == 2 || $post['express'] == 16))
 			{
 				echo json_encode(array('msg'=>'此快递方地址不可超出32个字符','success'=>false));exit;
 			}