Explorar el Código

防止二次添加

tgz hace 2 años
padre
commit
db7eda3020
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      app/controller/Track.php

+ 7 - 0
app/controller/Track.php

@@ -6,6 +6,7 @@ use support\Request;
 use support\Db;
 use App\services\TrackService;
 use support\facade\Logger;
+use App\model\DouyinTrack;
 
 class Track
 {
@@ -19,6 +20,12 @@ class Track
         if (empty($params['ua']) || $params['ua'] == '__UA__') {
             $params['ua'] = get_client_ua();
         }
+        if (getProp($params,'is_confirm')) {
+            $ishave = DouyinTrack::where('ip',$params['ip'])->where('distribution_channel_id',$params['channel_id'])->where('callback',$params['clickid'])->first();
+            if ($ishave) {
+                return 'success1' ;
+            }
+        }
         TrackService::push($params);
         return 'success' ;
     }