|
@@ -1062,11 +1062,34 @@ class Returngoods extends Start_Controller {
|
|
|
|
|
|
public function doMasterChcek($id,$post){
|
|
|
$info = $this->returngoods->read($id);
|
|
|
+
|
|
|
if(empty($info)){
|
|
|
return json_encode(['msg'=>'记录不存在!','success'=>false]);
|
|
|
}
|
|
|
if($info['status'] == 2){
|
|
|
- return json_encode(['msg'=>'订单已经被取消了,不能再操作!','success'=>false]);
|
|
|
+ return json_encode(['msg'=>'售后单已经被取消了,不能再操作!','success'=>false]);
|
|
|
+ }
|
|
|
+
|
|
|
+ $order_info = $this->_getOrderInfo($info['orderinfo']);
|
|
|
+ if(empty($order_info)){
|
|
|
+ return json_encode(['msg'=>'订单查询不到!','success'=>false]);
|
|
|
+ }
|
|
|
+ //仅退款 涉及退款 判断订单如果是processing + 已打印未出库状态
|
|
|
+ if($info['back_type'] == 1){
|
|
|
+ //207=> 订单processing状态 print=>3已打印 waybill 运单号 library 1 未出库 2 已出库 3 已退库
|
|
|
+ if(($order_info['state'] == 207)&&($order_info['print'] == 3) && !empty($order_info['waybill'])&&($order_info['library'] != 2)){
|
|
|
+ return json_encode(['msg'=>'订单为processing状态且已打印未出库不允许审核','success'=>false]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //退货退款 查询不到退货登记状态为已收到的订单,不允许审核通过
|
|
|
+ if( in_array($info['back_type'],[2,4])){
|
|
|
+ $r_info = $this->returns->get_number($info['number']);
|
|
|
+ if(empty($r_info)){
|
|
|
+ return json_encode(['msg'=>'未查询到退货登记单,不允许审核','success'=>false]);
|
|
|
+ }
|
|
|
+ if($r_info['qr'] != 1){
|
|
|
+ return json_encode(['msg'=>'退货登记单未处理,不允许审核','success'=>false]);
|
|
|
+ }
|
|
|
}
|
|
|
$time = date("Y-m-d H:i:s",time());
|
|
|
$user = $this->user->get_api($_SESSION['api']);
|