Pārlūkot izejas kodu

fix:回传配置关联推广

liuzejian 1 gadu atpakaļ
vecāks
revīzija
01c8129bb4

+ 4 - 1
modules/Callback/Http/Controllers/JLEvent/JLEventController.php

@@ -29,7 +29,10 @@ class JLEventController extends CatchController
         $unbind = $request->input('unbind', 0);
         $unbind = $request->input('unbind', 0);
 
 
         $result =  DB::table('jl_event_callback_config as config')
         $result =  DB::table('jl_event_callback_config as config')
-            ->leftJoin('promotions', 'promotions.callback_config_id', '=', 'config.id')
+            ->leftJoin('promotions', function($join){
+                $join->on('promotions.callback_config_id', '=', 'config.id')
+                    ->where('promotions.callback_type' , CallbackConst::TYPE_JL_EVENT_20);
+            })
             ->where([
             ->where([
                 'user_id' => $this->getLoginUserId(),
                 'user_id' => $this->getLoginUserId(),
             ])->when($id, function ($query, $id){
             ])->when($id, function ($query, $id){

+ 3 - 1
tests/Callback/Http/Controllers/JLEvent/JLEventControllerTest.php

@@ -52,7 +52,9 @@ class JLEventControllerTest extends UsedTestCase
         $res = $this->withHeaders([
         $res = $this->withHeaders([
             'Authorization' => 'Bearer '. $this->token,
             'Authorization' => 'Bearer '. $this->token,
         ])->json('get','http://localhost/api/callback/jlEvent/list', [
         ])->json('get','http://localhost/api/callback/jlEvent/list', [
-            'id' => 5,
+            'limit' => 20,
+            'promotion_id' => 6
+//            'id' => 5,
 //            'name' => 'liuzj',
 //            'name' => 'liuzj',
 //        'promotion_id' => 21
 //        'promotion_id' => 21
         ]);
         ]);