浏览代码

Merge branch 'liuzj-1001020-dev' into test

liuzejian 1 年之前
父节点
当前提交
11813d377a

+ 7 - 2
modules/Callback/Http/Controllers/CallbackLogController.php

@@ -135,7 +135,7 @@ class CallbackLogController extends CatchController
 
         $record = DB::table('callback_report_charge_record')
             ->where('id', $logId)
-            ->select('report_param')
+            ->select('report_param', 'filter_type')
             ->first();
         if(!$record || !$record->report_param) {
             CommonBusinessException::throwError(Errors::CALLBACK_RECORD_NOT_EXISTS);
@@ -147,7 +147,12 @@ class CallbackLogController extends CatchController
         }
 
         $reportService = new TiktokEventReportService();
-        $result = $reportService->reportCharge($requestInfo);
+        if('roi_report_all' == $record->filter_type) {
+            $result = $reportService->roiReportCharge($requestInfo);
+        } else {
+            $result = $reportService->reportCharge($requestInfo);
+        }
+
         $reportSuccess = 0;
         if($result['result']) {
             $resultContent = \json_decode($result['content'], true);

+ 2 - 1
modules/Callback/Http/Controllers/JuliangAccountController.php

@@ -18,7 +18,7 @@ class JuliangAccountController extends CatchController
 
     public function list(Request $request) {
         $advAccountId = $request->input('account_id');
-        $advAccountName = $request->input('account_name');
+        $advAccountName = $request->input('name');
         $unBind = $request->input('unbind', 0);
         $id =  $request->input('id', 0);
         $alreadyBindConfigIds = null;
@@ -83,6 +83,7 @@ class JuliangAccountController extends CatchController
         foreach ($list as $item) {
             $item->promotion_name = $promotions->get($item->id)->name ?? '';
             $item->promotion_id = $promotions->get($item->id)->id ?? '';
+            $item->name = $item->adv_account_name;
         }
 
         return $list;

+ 12 - 0
modules/Callback/Services/TiktokEventReportService.php

@@ -46,6 +46,18 @@ class TiktokEventReportService
 
     }
 
+    public function roiReportCharge($user) {
+        return $this->report($this->report_url, [
+            'event_type' => $this->purchase_roi_event_type,
+            'context' => [
+                'ad' => [
+                    'callback' => $user->callback
+                ]
+            ],
+            'timestamp' => time()
+        ]);
+    }
+
     /**
      * 付费上报
      */

+ 3 - 0
modules/Common/Repository/Options/JLEventCustomRate.php

@@ -4,6 +4,9 @@ namespace Modules\Common\Repository\Options;
 
 use Modules\Callback\Services\JLEventService;
 
+/**
+ * 巨量2.0事件--金额项的卡比例选项
+ */
 class JLEventCustomRate implements OptionInterface
 {
     public function get(): array

+ 2 - 1
modules/User/Models/User.php

@@ -110,7 +110,8 @@ class User extends Model implements AuthenticatableContract
         $appModules = Modules::getAppModules();
         if(!is_null($appModules)) {
             $hiddenAppModuleNames = $appModules->reject(function ($module) use ($showApp) {
-                return $showApp == $module['name'];
+                $apps = explode(',', $showApp);
+                return in_array($module['name'], $apps);
             })->pluck('name');
         } else {
             $hiddenAppModuleNames = collect();

+ 3 - 2
tests/User/Http/Controllers/UserControllerTest.php

@@ -36,7 +36,8 @@ class UserControllerTest extends \Tests\UsedTestCase
     public function testOnline() {
         $res = $this->withHeaders([
             'Authorization' => 'Bearer '. $this->token,
-        ])->json('get','http://localhost/api/user/online');
-        $res->dump();
+        ])->json('get','http://localhost/api/user/online?app=k');
+
+        $this->dumpJson($res);
     }
 }