fly 5 년 전
부모
커밋
c3e3cfd02a

+ 2 - 0
app/Http/Controllers/QuickApp/User/UserController.php

@@ -97,6 +97,7 @@ class UserController extends BaseController
      * @apiName sign
      * @apiSuccess {Double}  fee 签到奖励
      * @apiSuccess {Number}  days 签到天数
+     * @apiSuccess {Array}  day_list 签到列表
      * @apiSuccessExample {json} Success-Response:
      *
      *     {
@@ -105,6 +106,7 @@ class UserController extends BaseController
      *         "data": {
      *               "fee": 30,
      *               "days": 1
+     *               "day_list": []
      *             }
      *     }
      */

+ 9 - 3
app/Modules/User/Services/UserSignService.php

@@ -51,6 +51,7 @@ class UserSignService
     {
         //查看签到日期
         $sign_day = ReadRecordService::getSignDay($uid);
+
         if ($sign_day == -1) {
             return false;
         }
@@ -68,8 +69,8 @@ class UserSignService
                 $count = 1;
             }
         }
-
-        $fee = 30;
+        $fee = 0;
+        $day_list = [];
         if ($count % 7 == 1 && $count <= 7) {
             $fee = 30;
         } elseif ($count % 7 == 3) {
@@ -79,6 +80,11 @@ class UserSignService
         } else {
             $fee = 50;
         }
+        if ($count > 7) {
+            $day_list = [50, 50, 120, 50, 50, 50, 150];
+        } else {
+            $day_list = [30, 50, 120, 50, 50, 50, 150];
+        }
         if ($sign_day != $day) {
             UserService::addBalance($uid, $fee, 0, $fee);
             // 先扔到redis里面,异步更新user_sign表
@@ -95,7 +101,7 @@ class UserSignService
                 $user_sign_model->create($data);
             }
         }
-        return ['fee' => $fee, 'days' => $count];
+        return ['fee' => $fee, 'days' => $count, 'day_list' => $day_list];
     }
 
     public static function setUserSignVersion($uid, $version)

+ 8 - 1
public/kyydoc/api_data.js

@@ -3897,13 +3897,20 @@ define({ "api": [
             "optional": false,
             "field": "days",
             "description": "<p>签到天数</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "Array",
+            "optional": false,
+            "field": "day_list",
+            "description": "<p>签到列表</p>"
           }
         ]
       },
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "\n{\n    \"code\": 0,\n    \"msg\": \"\",\n    \"data\": {\n          \"fee\": 30,\n          \"days\": 1\n        }\n}",
+          "content": "\n{\n    \"code\": 0,\n    \"msg\": \"\",\n    \"data\": {\n          \"fee\": 30,\n          \"days\": 1\n          \"day_list\": []\n        }\n}",
           "type": "json"
         }
       ]

+ 8 - 1
public/kyydoc/api_data.json

@@ -3897,13 +3897,20 @@
             "optional": false,
             "field": "days",
             "description": "<p>签到天数</p>"
+          },
+          {
+            "group": "Success 200",
+            "type": "Array",
+            "optional": false,
+            "field": "day_list",
+            "description": "<p>签到列表</p>"
           }
         ]
       },
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "\n{\n    \"code\": 0,\n    \"msg\": \"\",\n    \"data\": {\n          \"fee\": 30,\n          \"days\": 1\n        }\n}",
+          "content": "\n{\n    \"code\": 0,\n    \"msg\": \"\",\n    \"data\": {\n          \"fee\": 30,\n          \"days\": 1\n          \"day_list\": []\n        }\n}",
           "type": "json"
         }
       ]

+ 1 - 1
public/kyydoc/api_project.js

@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-11-04T03:53:38.276Z",
+    "time": "2019-11-05T02:53:02.243Z",
     "url": "http://apidocjs.com",
     "version": "0.17.7"
   }

+ 1 - 1
public/kyydoc/api_project.json

@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-11-04T03:53:38.276Z",
+    "time": "2019-11-05T02:53:02.243Z",
     "url": "http://apidocjs.com",
     "version": "0.17.7"
   }