tgz hace 2 años
padre
commit
b2acea5404
Se han modificado 2 ficheros con 10 adiciones y 4 borrados
  1. 1 1
      app/controller/Track.php
  2. 9 3
      app/services/TrackService.php

+ 1 - 1
app/controller/Track.php

@@ -21,7 +21,7 @@ class Track
         }
         if (getProp($params,'is_confirm')) {
             $res = TrackService::confirm($params);
-            if ($res) {
+            if (!$res) {
                 return 'success1' ;
             }
         }

+ 9 - 3
app/services/TrackService.php

@@ -103,13 +103,19 @@ class TrackService
     
 
     /**
-     *  二次确认处理
+     *  二次确认处理, 不让继续添加到表里处理;就返回FALSE
      */
     public static function confirm ($params){
        $dycallback = getProp($params,'dycallback');
+       $channel_id = getProp($params,'channel_id');
+       $ip = getProp($params,'ip');
        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;
+           $clickid = getProp($params,'clickid');
+           if (!$clickid) {
+               return false;
+           }
+           $id = DouyinTrack::where('ip',$ip)->where('distribution_channel_id',$channel_id)->where('callback',$clickid)->value('id');
+           return $id > 0 ? false : $id;
        }
        
     }