Browse Source

修改tt回执的错误

lvhao 1 month ago
parent
commit
10452c71e5
1 changed files with 12 additions and 7 deletions
  1. 12 7
      core/CoreApp/controllers/Apitt.php

+ 12 - 7
core/CoreApp/controllers/Apitt.php

@@ -1065,7 +1065,9 @@ $j = json_decode($j, true);
 		if(isset($post['j']))
 		{
 			$j = $this->input->post('j',true);
+			
 			$j = json_decode($j, true);
+			$this->logic_ding->sendToDing("获取TT的webhook数据:".json_encode($j));
 			$xq = array();
 			if($j['type'] == 1 && $j['data']['order_status'] == 'UNPAID')
 			{
@@ -1204,15 +1206,18 @@ $j = json_decode($j, true);
 				}
 				if($j['type'] == 2)
 				{
-					if($j['reverse_order_status '] == 50 || $j['reverse_order_status '] == 51)
-				    {
-						$whlabel = $this->whlabel->find_all("zd = '".$d['number']."'");
-						foreach ($whlabel as $v) 
-		       		    {
-							$this->whlabel->save(array('zd'=>''),$v['id']);
+					if(isset($j['reverse_order_status'])){
+						if($j['reverse_order_status'] == 50 || $j['reverse_order_status'] == 51)
+						{
+							$whlabel = $this->whlabel->find_all("zd = '".$d['number']."'");
+							foreach ($whlabel as $v) 
+							   {
+								$this->whlabel->save(array('zd'=>''),$v['id']);
+							}
+							$this->fullordertt->save(array('state'=>214,'whlabel'=>$d['whlabel'],'fpdata'=>$d['fpdata']),$d['id']);
 						}
-					    $this->fullordertt->save(array('state'=>214,'whlabel'=>$d['whlabel'],'fpdata'=>$d['fpdata']),$d['id']);
 					}
+					
 					/**
 					reverse_order_status
 					售后申请 = 1