Jelajahi Sumber

二次确认

tgz 2 tahun lalu
induk
melakukan
ab48bd33dd
2 mengubah file dengan 14 tambahan dan 3 penghapusan
  1. 2 3
      app/controller/Track.php
  2. 12 0
      app/services/TrackService.php

+ 2 - 3
app/controller/Track.php

@@ -6,7 +6,6 @@ use support\Request;
 use support\Db;
 use App\services\TrackService;
 use support\facade\Logger;
-use App\model\DouyinTrack;
 
 class Track
 {
@@ -21,8 +20,8 @@ class Track
             $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) {
+            $res = TrackService::confirm($params);
+            if ($res) {
                 return 'success1' ;
             }
         }

+ 12 - 0
app/services/TrackService.php

@@ -101,5 +101,17 @@ class TrackService
         }
     }
     
+
+    /**
+     *  二次确认处理
+     */
+    public static function confirm ($params){
+       $dycallback = getProp($params,'dycallback');
+       if ($dycallback == 1) {
+           $id = DouyinTrack::where('ip',$params['ip'])->where('distribution_channel_id',$params['channel_id'])->where('callback',$params['clickid'])->value('id');
+           return $id > 0 ? $id : 0;
+       }
+       
+    }
     
 }