fly 4 years ago
parent
commit
a97629a3be

+ 0 - 42
src/Requests/Request.php

@@ -28,12 +28,6 @@ abstract class Request extends FormRequest
             'required' => '缺少参数:attribute',
             'integer' => ':attribute 必须是整数类型',
             'date' => ':attribute 必须是日期格式',
-            'max' => [
-                'numeric' => ':attribute不能超过 :max.',
-                'file' => '文件:attribute大小不能超过 :max kilobytes.',
-                'string' => '字符:attribute 不能超过 :max 长度.',
-                'array' => '数组:attribute 不能超过 :max 长度.',
-            ],
             'accepted' => 'The :attribute must be accepted.',
             'active_url' => ':attribute 是个无效链接.',
             'after' => 'The :attribute must be a date after :date.',
@@ -59,18 +53,6 @@ abstract class Request extends FormRequest
             'exists' => ':attribute 不存在.',
             'file' => 'The :attribute must be a file.',
             'filled' => 'The :attribute field must have a value.',
-            'gt' => [
-                'numeric' => 'The :attribute must be greater than :value.',
-                'file' => 'The :attribute must be greater than :value kilobytes.',
-                'string' => 'The :attribute must be greater than :value characters.',
-                'array' => 'The :attribute must have more than :value items.',
-            ],
-            'gte' => [
-                'numeric' => 'The :attribute must be greater than or equal :value.',
-                'file' => 'The :attribute must be greater than or equal :value kilobytes.',
-                'string' => 'The :attribute must be greater than or equal :value characters.',
-                'array' => 'The :attribute must have :value items or more.',
-            ],
             'image' => 'The :attribute 必须是一张图片.',
             'in' => '选项 :attribute 不在给定范围中.',
             'in_array' => 'The :attribute field does not exist in :other.',
@@ -78,26 +60,8 @@ abstract class Request extends FormRequest
             'ipv4' => 'The :attribute must be a valid IPv4 address.',
             'ipv6' => 'The :attribute must be a valid IPv6 address.',
             'json' => 'The :attribute must be a valid JSON string.',
-            'lt' => [
-                'numeric' => 'The :attribute must be less than :value.',
-                'file' => 'The :attribute must be less than :value kilobytes.',
-                'string' => 'The :attribute must be less than :value characters.',
-                'array' => 'The :attribute must have less than :value items.',
-            ],
-            'lte' => [
-                'numeric' => 'The :attribute must be less than or equal :value.',
-                'file' => 'The :attribute must be less than or equal :value kilobytes.',
-                'string' => 'The :attribute must be less than or equal :value characters.',
-                'array' => 'The :attribute must not have more than :value items.',
-            ],
             'mimes' => 'The :attribute must be a file of type: :values.',
             'mimetypes' => 'The :attribute must be a file of type: :values.',
-            'min' => [
-                'numeric' => 'The :attribute must be at least :min.',
-                'file' => 'The :attribute must be at least :min kilobytes.',
-                'string' => 'The :attribute must be at least :min characters.',
-                'array' => 'The :attribute must have at least :min items.',
-            ],
             'not_in' => 'The selected :attribute is invalid.',
             'not_regex' => 'The :attribute format is invalid.',
             'numeric' => 'The :attribute must be a number.',
@@ -110,12 +74,6 @@ abstract class Request extends FormRequest
             'required_without' => 'The :attribute field is required when :values is not present.',
             'required_without_all' => 'The :attribute field is required when none of :values are present.',
             'same' => 'The :attribute and :other must match.',
-            'size' => [
-                'numeric' => 'The :attribute must be :size.',
-                'file' => 'The :attribute must be :size kilobytes.',
-                'string' => 'The :attribute must be :size characters.',
-                'array' => 'The :attribute must contain :size items.',
-            ],
             'starts_with' => 'The :attribute must start with one of the following: :values',
             'string' => 'The :attribute must be a string.',
             'timezone' => 'The :attribute must be a valid zone.',

+ 29 - 0
src/Services/LandingPage/ChargeFeedBack/QappRereport.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace General\Services\LandingPage\ChargeFeedBack;
+
+/**
+ * qapp付费重传
+ */
+class QappRereport
+{
+    public function reportInstance(string $link_source): BaseReport
+    {
+        $name  = 'Qapp' . ucfirst($link_source) . 'Report';
+        $namespace = "\\General\\Services\\Report\\{$name}";
+        $instance = new $namespace;
+        return $instance;
+    }
+
+    public function addReportCount(ReportUserBindRecord $report_user)
+    {
+        $service = new Report;
+        $user = User::find($report_user->uid);
+        $service->report('api/report/add', [
+            'source' => BaseConst::Platform,
+            'adid' => $report_user->adid,
+            'channel_id' => $user->distribution_channel_id,
+            'send_order_id' => $user->send_order_id,
+        ]);
+    }
+}

+ 48 - 0
src/Services/LandingPage/ChargeFeedBack/Rereport.php

@@ -0,0 +1,48 @@
+<?php
+
+namespace General\Services\LandingPage\ChargeFeedBack;
+
+/**
+ * 付费重传
+ */
+class Rereport
+{
+    public function reportInstance(string $link_source): BaseReport
+    {
+        $name  = ucfirst($link_source) . 'Report';
+        $namespace = "\\General\\Services\\Report\\{$name}";
+        $instance = new $namespace;
+        return $instance;
+    }
+
+    public function addReportCount(ReportUserBindRecord $report_user)
+    {
+        $service = new Report;
+        $user = User::find($report_user->uid);
+        $service->report('api/report/add', [
+            'source' => BaseConst::Platform,
+            'adid' => $report_user->adid,
+            'channel_id' => $user->distribution_channel_id,
+        ]);
+    }
+
+    public function reReport(int $bind_id, float $amount, string $order_no)
+    {
+        $report_user = ReportUserBindRecord::find($bind_id);
+        if ($report_user) {
+            $instance = $this->reportInstance($report_user->platform);
+            $result =  $instance->reportCharge($report_user, $amount);
+            ReportUserChargeRecord::updateOrCreate(
+                [
+                    'order_no' => $order_no,
+                ],
+                [
+                    'uid' => $report_user->uid,
+                    'status' => $result['result'],
+                    'content' => $result['result'] ? '手动回传' : $result['content'],
+                ]
+            );
+            $this->addReportCount($report_user);
+        }
+    }
+}

+ 4 - 39
src/Services/LandingPage/LandingPageLinkService.php

@@ -16,6 +16,8 @@ use General\Services\Report\BaseReport;
 use General\Services\Config\ConfigService;
 use General\Services\LandingPage\ChargeFeedBack\NormalChargeFeedBack;
 use General\Services\LandingPage\ChargeFeedBack\OrangeChargeFeedBack;
+use General\Services\LandingPage\ChargeFeedBack\QappRereport;
+use General\Services\LandingPage\ChargeFeedBack\Rereport;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\DB;
 use Redis;
@@ -284,46 +286,9 @@ class LandingPageLinkService
         return BaiDuAdAccount::where('is_enabled', 1)->where('channel_user_id', $channel_user_id)->get();
     }
 
-    public function reportInstance(string $link_source, bool $is_qapp): BaseReport
-    {
-        $name = $is_qapp ? 'Qapp' . ucfirst($link_source) . 'Report' : ucfirst($link_source) . 'Report';
-        $namespace = "\\General\\Services\\Report\\{$name}";
-        $instance = new $namespace;
-        return $instance;
-    }
-
     public function reReport(int $bind_id, float $amount, string $order_no, bool $is_qapp = false)
     {
-        $report_user = ReportUserBindRecord::find($bind_id);
-        if ($report_user) {
-            $instance = $this->reportInstance($report_user->platform, $is_qapp);
-            $result =  $instance->reportCharge($report_user, $amount);
-            ReportUserChargeRecord::updateOrCreate(
-                [
-                    'order_no' => $order_no,
-                ],
-                [
-                    'uid' => $report_user->uid,
-                    'status' => $result['result'],
-                    'content' => $result['result'] ? '手动回传' : $result['content'],
-                ]
-            );
-            $service = new Report;
-            $user = User::find($report_user->uid);
-            if ($is_qapp) {
-                $service->report('api/report/add', [
-                    'source' => BaseConst::Platform,
-                    'adid' => $report_user->adid,
-                    'channel_id' => $user->distribution_channel_id,
-                    'send_order_id' => $user->send_order_id,
-                ]);
-            } else {
-                $service->report('api/report/add', [
-                    'source' => BaseConst::Platform,
-                    'adid' => $report_user->adid,
-                    'channel_id' => $user->distribution_channel_id,
-                ]);
-            }
-        }
+        $service = $is_qapp ? new QappRereport : new Rereport;
+        $service->reReport($bind_id, $amount, $order_no);
     }
 }