瀏覽代碼

二次确认

tgz 2 年之前
父節點
當前提交
ab48bd33dd
共有 2 個文件被更改,包括 14 次插入3 次删除
  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;
+       }
+       
+    }
     
 }