Browse Source

修改boss的dpd查询

lvhao 3 ngày trước cách đây
mục cha
commit
6053246353

+ 28 - 0
core/CoreApp/controllers/Boss.php

@@ -94,6 +94,8 @@ class Boss extends Start_Controller
 			$this->_dycs();
 		}else if($arg =='yxdpdck'){
 			$this->_yxDPDchuku();
+		}else if($arg == 'yxdpdcx'){
+			$this->_bossyxdpdcx();
 		}else if($arg == 'spexceljs'){
 			$this->_spexceljs();	
 		} else {
@@ -2389,4 +2391,30 @@ class Boss extends Start_Controller
 		echo json_encode(array('msg' => '已成功提交', 'success' => true));
 		exit;
 	}
+	public function _bossyxdpdcx(){
+		$params = $this->input->post(NULL, TRUE);
+		if(empty($params['order'])){
+			$params = $this->input->get(NULL, TRUE);
+		}
+		if(empty($params['order'])){
+			echo json_encode(array('msg' => '请填写运单号', 'success' => false));
+			exit;
+		}
+		$y = $this->logic_order->getInfo("waybill = '".$params['order']."'","*");
+		if(empty($y)){
+			echo json_encode(array('msg' => '请核对运单号是否正确', 'success' => false));
+			exit;
+		}
+		if(!in_array($y['express'],[78,79,84])){
+			echo json_encode(array('msg' => '非DPD快递不支持此操作', 'success' => false));
+			exit;
+		}
+		$res = $this->check->showOverdue($y['name'],$y['number'],$y['address']);
+		if($res['code'] == 1){
+			echo json_encode(array('msg' => $res['msg'], 'data' => [], 'success' => true));
+		}else{
+			echo json_encode(array('msg' => $res['msg'], 'data' => [], 'success' => false));
+		}
+		exit;
+	}
 }

+ 32 - 1
core/CoreApp/models/Model_check.php

@@ -30,7 +30,8 @@ class Model_check extends Lin_Model
 			'check_name' => $check_name,
 			'number' => $number,
 			'addtime' => time(),
-			'zx_hours'=> 72
+			'zx_hours'=> 72,
+			'status' => 1
 		]);
 		return true;
 	}
@@ -53,6 +54,36 @@ class Model_check extends Lin_Model
 		return true;
 	}
 
+
+	public function showOverdue($check_name,$number,$check_address){
+		$check_name = trim($check_name);
+		$check_address = trim($check_address);
+		if(empty($check_name) || empty($check_address)){
+			return [
+				'code'=>-1,
+				'msg'=>'参数传递异常'
+			];
+		}
+		$limit_time = time() - 72*60*60;
+		$info =  $this->find("(status = 1)   and  (addtime >=  ".$limit_time.") and ((check_name = '".$check_name."') or (check_address like '%".$check_address."%'))","*",'addtime DESC');	
+		if(empty($info)){
+			return [
+				'code'=>-1,
+				'msg'=>'未找到有效的限制单-1'
+			];
+		}
+		if($info['number'] == $number){
+			return [
+				'code'=>-1,
+				'msg'=>'未找到有效的限制单-2'
+			];
+		}
+		return [
+			'code'=>1,
+			'msg'=>"限制单:".$info['number']
+		];
+	}
+
 	public function checkOverduetest($check_name,$number,$check_address){
 		$check_name = trim($check_name);
 		$check_address = trim($check_address);

+ 6 - 0
template/erp/boss.html

@@ -14,6 +14,12 @@
     <li><font class="bossok" style="width: 200px;" data-c="bossyxdpdck" data-u="yxdpdck">确定解除限制</font></li>
 </ul>
 
+<ul class="search bossyxdpdcx" style="border-bottom: 1px solid #ccc;padding:16px 0">
+    <p style="color:#666;font-size: 18px;line-height:50px;">根据输入的信息查询,返回限制出库的订单信息</p>
+    <li>运单号:<input value="" name="order" type="text" style="width:268px"></li>
+    <li><font class="bossok" style="width: 200px;" data-c="bossyxdpdcx" data-u="yxdpdcx">查 询</font></li>
+</ul>
+
 <ul class="search qczd" style="border-bottom: 1px solid #ccc;padding:16px 0">
 <p style="color:#666;font-size: 18px;line-height:50px;">清除占单</p>
 <li>订单编号:<input value="" name="number" type="text" style="width:150px;text-align: center;"></li>