Ken před 10 hodinami
rodič
revize
04919d61dc

+ 8 - 3
app/Http/Controllers/api/ActivityReward.php

@@ -26,11 +26,16 @@ class ActivityReward extends BaseController
     public function rule(): JsonResponse
     {
         try {
-            $activityRole = ConfigService::getVal("activity_rule");
+            $data['rule'] = ConfigService::getVal("activity_rule");
+
+            $data['rebate']['title'] = ConfigService::getRemark("benefits_bibi_return");
+            $data['rebate']['sub_title'] = ConfigService::getVal("benefits_bibi_return");
+
+
         } catch (Exception $e) {
             return $this->error($e->getMessage(), [], $e->getCode());
         }
-        return $this->success($activityRole);
+        return $this->success($data);
     }
 
     //验证手机号
@@ -101,7 +106,7 @@ class ActivityReward extends BaseController
                 throw new Exception('已参与过此活动,每个活动仅可参加一次', HttpStatus::CUSTOM_ERROR);
             }
 
-            if (ActivityUser::where('member_id', $memberId)->whereIn('status', [ActivityUser::STATUS_APPLY,ActivityUser::STATUS_IN_PROGRESS])->exists()) {
+            if (ActivityUser::where('member_id', $memberId)->whereIn('status', [ActivityUser::STATUS_APPLY, ActivityUser::STATUS_IN_PROGRESS])->exists()) {
                 throw new Exception('您有正在进行的活动,不可同时参与多个活动', HttpStatus::CUSTOM_ERROR);
             }
 

+ 7 - 0
app/Services/ConfigService.php

@@ -167,6 +167,13 @@ class ConfigService extends BaseService
         return $result;
     }
 
+    public static function getRemark(string $field)
+    {
+        $config = static::$MODEL::where('field', $field)->first();
+        if ($config) return $config->remark;
+        throw new Exception("参数不存在", HttpStatus::CUSTOM_ERROR);
+    }
+
     public static function getVal(string $field)
     {
         $config = static::$MODEL::where('field', $field)->first();