lvhao 1 month ago
parent
commit
ca3ba20a32
1 changed files with 10 additions and 5 deletions
  1. 10 5
      core/CoreApp/controllers/Apitt.php

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

@@ -1019,7 +1019,8 @@ $j = json_decode($j, true);
 			}
 			else
 			{
-			    //$this->fullordertt->save(array('exstateerror'=>'当前订单状态无匹配模板 - state:'.$fullorder['state'].' - shop:'.$fullorder['shop'].' - time:'.$time.' - type:'.$type.'  - notice:'.json_encode($notice)),$fullorder['id']);
+				$fid = $this->fullordertt->get_orderinfo($order_id);
+			    $this->fullordertt->save(array('exstateerror'=>'当前订单状态无匹配模板 - state:'.$fullorder['state'].' - shop:'.$fullorder['shop'].' - time:'.$time.' - type:'.$type.'  - notice:'.json_encode($notice)),$fid['id']);
 			}
 		}
 	}
@@ -1083,10 +1084,14 @@ $j = json_decode($j, true);
 				if(isset($d['data']['orders'][0]['user_id']))
 				{
 				    $post = array('orderinfo'=>$j['data']['order_id'],'user_id'=>$d['data']['orders'][0]['user_id']);
-				    $id = $this->ttcf->insert($post);
-					$post['shop'] = $shop['id'];
-					$post['id'] = $id;
-				    $this->_znxc($post,$post['orderinfo'],3);
+					$num = $this->ttcf->find_count('orderinfo = '.$post['orderinfo']);
+					if(!$num){
+						$id = $this->ttcf->insert($post);
+						$post['shop'] = $shop['id'];
+						$post['id'] = $id;
+						$this->_znxc($post,$post['orderinfo'],3);
+					}
+				    
 				}
 				exit;
 			}