Bladeren bron

避免tt的外键引起的存储报错

lvhao 1 maand geleden
bovenliggende
commit
d1eb8a2c94
1 gewijzigde bestanden met toevoegingen van 5 en 1 verwijderingen
  1. 5 1
      core/CoreApp/controllers/Apitt.php

+ 5 - 1
core/CoreApp/controllers/Apitt.php

@@ -1041,7 +1041,11 @@ $j = json_decode($j, true);
 			}
 			else
 			{
-				$this->ttwebhook->insert(array('tid'=>$j['tts_notification_id'],'orderinfo'=>$j['data']['order_id'],'data'=>$data,'time'=>date("Y-m-d H:i:s",time())));
+				$num = $this->ttwebhook->find_count("data = ".$data);
+				if(!$num){
+					$this->ttwebhook->insert(array('tid'=>$j['tts_notification_id'],'orderinfo'=>$j['data']['order_id'],'data'=>$data,'time'=>date("Y-m-d H:i:s",time())));
+				}
+				
 			}
 			$ch = curl_init();
 		    curl_setopt($ch,CURLOPT_URL,'http://a10.wepolicy.cn/apitt/ttwebhook');