瀏覽代碼

Update api

dyjh 6 年之前
父節點
當前提交
7051db27ff

+ 5 - 4
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd xqd xqd
@@ -661,7 +661,7 @@ class AlbumController extends Controller
      *     "status_code": 0,
      *     "message": "",
      *     "data": [
-     *          {
+     *        "type1":{   1 收藏  2查看类目 3查看商品 4登陆 5点击图片 6 点击导航 7一键拨号
      *              "time": 2018-1-1 10:10:12,
      *              "action": '做了什么什么都做',
      *              "user": [
@@ -670,6 +670,8 @@ class AlbumController extends Controller
      *                  "phone":"1123123123123"
      *              ]
      *          }
+     *          ...
+     *          "count":6;
      *      ]
      * }
      * @apiErrorExample {json} Error-Response:
@@ -702,7 +704,6 @@ class AlbumController extends Controller
         $res = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]])->get();
         $count_user = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]])->groupBy('open_id')->get();
         $count = count($count_user);
-        dd($count);
         $action = '';
         foreach($res as $key=>$val){
             if($val->action==4){
@@ -737,13 +738,13 @@ class AlbumController extends Controller
                 $action = '查看了您的电话'.$phone.',并且点击了拨号';
             }
             $user = AlbumUserModel::where([['wechat_open_id',$val->open_id],['store_id',$val->store_id]])->select(['username','avatar','phone'])->first();
-            $data_res[] = [
-                'type'=>$val->action,
+            $data_res['type'.$val->action][] = [
                 'time'=>$val->created_at,
                 'action'=>$action,
                 'user'=>$user
             ];
         }
+        $data_res['count'] = $count;
         return $this->api(compact('data_res'));
     }
 

+ 1 - 1
public/apidoc/api_data.js

xqd
@@ -569,7 +569,7 @@ define({ "api": [
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n         {\n             \"time\": 2018-1-1 10:10:12,\n             \"action\": '做了什么什么都做',\n             \"user\": [\n                 \"username\":\"王小贱\",\n                 \"avatar\":\"awdawdawdawdawdawd\",头像\n                 \"phone\":\"1123123123123\"\n             ]\n         }\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n       \"type1\":{   1 收藏  2查看类目 3查看商品 4登陆 5点击图片 6 点击导航 7一键拨号\n             \"time\": 2018-1-1 10:10:12,\n             \"action\": '做了什么什么都做',\n             \"user\": [\n                 \"username\":\"王小贱\",\n                 \"avatar\":\"awdawdawdawdawdawd\",头像\n                 \"phone\":\"1123123123123\"\n             ]\n         }\n         ...\n         \"count\":6;\n     ]\n}",
           "type": "json"
         }
       ]

+ 1 - 1
public/apidoc/api_data.json

xqd
@@ -569,7 +569,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n         {\n             \"time\": 2018-1-1 10:10:12,\n             \"action\": '做了什么什么都做',\n             \"user\": [\n                 \"username\":\"王小贱\",\n                 \"avatar\":\"awdawdawdawdawdawd\",头像\n                 \"phone\":\"1123123123123\"\n             ]\n         }\n     ]\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n       \"type1\":{   1 收藏  2查看类目 3查看商品 4登陆 5点击图片 6 点击导航 7一键拨号\n             \"time\": 2018-1-1 10:10:12,\n             \"action\": '做了什么什么都做',\n             \"user\": [\n                 \"username\":\"王小贱\",\n                 \"avatar\":\"awdawdawdawdawdawd\",头像\n                 \"phone\":\"1123123123123\"\n             ]\n         }\n         ...\n         \"count\":6;\n     ]\n}",
           "type": "json"
         }
       ]

+ 1 - 1
public/apidoc/api_project.js

xqd
@@ -9,7 +9,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2018-11-14T02:49:23.700Z",
+    "time": "2018-11-21T06:03:30.975Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 1 - 1
public/apidoc/api_project.json

xqd
@@ -9,7 +9,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2018-11-14T02:49:23.700Z",
+    "time": "2018-11-21T06:03:30.975Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }