dyjh 6 years ago
parent
commit
abf5329571

+ 294 - 50
app/Http/Controllers/Api/V1/AlbumBossController.php

xqd xqd xqd xqd
@@ -293,8 +293,8 @@ class AlbumBossController extends Controller
     }
 
     /**
-     * @api {post} /api/album_boss/agent_overview 经销商总览(agent_overview)
-     * @apiDescription 经销商总览(agent_overview)
+     * @api {post} /api/album_boss/agent_overview_active 经销商总览活跃客户(agent_overview_active)
+     * @apiDescription 经销商总览活跃客户(agent_overview_active)
      * @apiGroup Boss
      * @apiPermission none
      * @apiVersion 0.1.0
@@ -308,23 +308,181 @@ class AlbumBossController extends Controller
      *     "status_code": 0,
      *     "message": "",
      *     "data": {
-     *         "customerFollow":11,
-     *         "downloadCount":11,
-     *         "shareCount":11,
-     *         "newCustomerCount":11,
-     *         "totalCustomerCount":11,
      *         "activeCustomers": [
      *              {
      *                  "day" : 03/25,
      *                  "num" : 111
      *              }
      *          ],
-     *          "newCustomers": [
-     *              {
-     *                  "day" : 03/25,
-     *                  "num" : 111
-     *              }
-     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewActive(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+
+        $activeCustomers = array();
+        for ($d = 0; $d < 15; $d++) {
+            $StartO = mktime(0, 0, 0, date('m'), date('d'), date('y')) + 86400 * $d;
+            $EndO = $StartO + 86400;
+            $End = date('Y-m-d H:i:s', $EndO);
+            $Start = date('Y-m-d H:i:s', $StartO);
+            $customerNum = AlbumWatchRecord::where([
+                ['store_id', $store_id],
+                ['updated_at','>=',$Start],
+                ['updated_at','<=',$End]
+            ])->orderByDesc('id')->groupBy('open_id')->count();
+            $activeCustomers[] = [
+                'day' => date('m', $StartO) . '-' . date('d', $EndO),
+                'num' => $customerNum
+            ];
+        }
+        return $this->api($activeCustomers);
+    }
+
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_left 经销商总览左侧(agent_overview_left)
+     * @apiDescription 经销商总览左侧(agent_overview_left)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "customerFollow":11,
+     *         "downloadCount":11,
+     *         "shareCount":11,
+     *         "newCustomerCount":11,
+     *         "totalCustomerCount":11,
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewLeft(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $end = $request->input('end');
+        $start = $request->input('start');
+        $store_id = $request->input('store_id');
+        if (!$end) {
+            $end = time();
+        }
+        if (!$start) {
+            $start = 0;
+        }
+        $end = date('Y-m-d H:i:s', $end);
+        $start = date('Y-m-d H:i:s', $start);
+
+        $customerFollow = CustomerDetailsModel::where('store_id', $store_id)->count();
+        $downloadCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['action', 9],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $shareCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['action', 8],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $newCustomerCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['is_new', 1],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $totalCustomerCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->groupBy('open_id')->count();
+        return $this->api(compact('totalCustomerCount', 'newCustomerCount', 'shareCount', 'downloadCount', 'customerFollow'));
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_favorite 经销商总览兴趣占比(agent_overview_favorite)
+     * @apiDescription 经销商总览兴趣占比(agent_overview_favorite)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
      *          "arrFavorite": [
      *              {
      *                  'name':'asdawd',
@@ -345,7 +503,7 @@ class AlbumBossController extends Controller
      * 可能出现的错误代码:
      *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
-    public function albumOverview(Request $request)
+    public function albumOverviewFavorite(Request $request)
     {
 
         $userAuth = Auth('api')->user();
@@ -399,60 +557,146 @@ class AlbumBossController extends Controller
             }
             $total++;
         }
-        $activeCustomers = array();
+        foreach ($arrFavorite as $key => $val) {
+            $arrFavorite[$key]['point'] = ($val['num'] / $total * 100) . '%';
+        }
+        return $this->api($arrFavorite);
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_new 经销商总览新增客户(agent_overview_new)
+     * @apiDescription 经销商总览新增客户(agent_overview_new)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *          "newCustomers": [
+     *              {
+     *                  "day" : 03/25,
+     *                  "num" : 111
+     *              }
+     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewNew(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+
         $newCustomers = array();
         for ($d = 0; $d < 15; $d++) {
             $StartO = mktime(0, 0, 0, date('m'), date('d'), date('y')) + 86400 * $d;
             $EndO = $StartO + 86400;
             $End = date('Y-m-d H:i:s', $EndO);
             $Start = date('Y-m-d H:i:s', $StartO);
-            $customerNum = AlbumWatchRecord::where([
-                ['store_id', $store_id],
-                ['updated_at','>=',$Start],
-                ['updated_at','<=',$End]
-            ])->orderByDesc('id')->groupBy('open_id')->count();
             $newCustomer = AlbumWatchRecord::where([
                 ['store_id', $store_id],
                 ['is_new', 1],
                 ['updated_at','>=',$Start],
                 ['updated_at','<=',$End]
             ])->orderByDesc('id')->count();
-            $activeCustomers[] = [
-                'day' => date('m', $StartO) . '-' . date('d', $EndO),
-                'num' => $customerNum
-            ];
             $newCustomers[] = [
                 'day' => date('m', $StartO) . '-' . date('d', $EndO),
                 'num' => $newCustomer
             ];
         }
-        $customerFollow = CustomerDetailsModel::where('store_id', $store_id)->count();
-        $downloadCount = AlbumWatchRecord::where([
-            ['store_id', $store_id],
-            ['action', 9],
-            ['updated_at','>=',$start],
-            ['updated_at','<=',$end]
-        ])->orderByDesc('id')->count();
-
-        $shareCount = AlbumWatchRecord::where([
-            ['store_id', $store_id],
-            ['action', 8],
-            ['updated_at','>=',$start],
-            ['updated_at','<=',$end]
-        ])->orderByDesc('id')->count();
 
-        $newCustomerCount = AlbumWatchRecord::where([
-            ['store_id', $store_id],
-            ['is_new', 1],
-            ['updated_at','>=',$start],
-            ['updated_at','<=',$end]
-        ])->orderByDesc('id')->count();
+        return $this->api($newCustomers);
+    }
 
-        $totalCustomerCount = AlbumWatchRecord::where([
-            ['store_id', $store_id],
-            ['updated_at','>=',$start],
-            ['updated_at','<=',$end]
-        ])->orderByDesc('id')->groupBy('open_id')->count();
-        return $this->api(compact('totalCustomerCount', 'newCustomerCount', 'shareCount', 'downloadCount', 'customerFollow', 'newCustomers', 'activeCustomers', 'arrFavorite'));
+    /**
+     * @api {post} /api/album_boss/agent_analysis 经销商分析(agent_analysis)
+     * @apiDescription 经销商分析(agent_analysis)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": [
+     *         {
+     *             "realname" : 释迦摩尼,
+     *             "pointCount" : 111
+     *             "callCount" : 111
+     *             "favoriteCount" : 111
+     *             "get_count" : 111
+     *             "share_times" : 111
+     *             "newCount" : 111
+     *         }
+     *     ]
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function agentAnalysis(Request $request)
+    {
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+        $store_id = $request->input('store_id');
+        $agent = AlbumAgentModel::where('store_id', $store_id)->orderByDesc('newCount')->select('realname', 'pointCount', 'callCount', 'favoriteCount', 'get_count', 'share_times', 'newCount')->pagenate(12);
+        return $this->api($agent);
     }
 }

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

xqd xqd xqd xqd
@@ -242,6 +242,7 @@ class AlbumController extends Controller
                         $user_agent->get_count++;
                     }
                     $user_agent->pointCount++;
+                    $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
                     $user_agent->save();
                     $agent = AlbumUserModel::where([['id',$user_agent->user_id],['store_id',$datas['store_id']]])->first();
                     $this->sendLogsMessage($datas['store_id'], $agent->open_id, 4, $userAuth->username, $agent->g_open_id);
@@ -1373,6 +1374,7 @@ class AlbumController extends Controller
         if ($userAuth->up_agent_id != 0) {
             $agent = AlbumAgentModel::where('id'. 'up_agent_id')->first();
             $agent->favoriteCount++;
+            $agent->newCount = $agent->pointCount + $agent->favoriteCount + $agent->callCount + $agent->share_times + $agent->get_count;
             $agent->save();
             $add_record['agent_id'] = $userAuth->up_agent_id;
             $add_record['open_id'] = $userAuth->open_id;
@@ -1737,6 +1739,7 @@ class AlbumController extends Controller
             $user_agent = AlbumAgentModel::where('id',$userAuth->up_agent_id)->first();
             if ($data['type'] == 7 || $data['type'] == 6) {
                 $user_agent->callCount++;
+                $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
                 $user_agent->save();
             }
             $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
@@ -2576,10 +2579,10 @@ class AlbumController extends Controller
         }
         $store_id = $request->input('store_id');
         $goods_id = $request->input('goods_id');
-
         if($userAuth->up_agent_id !=0){
             $user_agent = AlbumAgentModel::where([['id',$userAuth->up_agent_id],['status',1]])->first();
             $user_agent->share_times++;
+            $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
             $user_agent->save();
         }
 

+ 1 - 1
app/Http/Controllers/Api/V1/Controller.php

xqd
@@ -23,7 +23,7 @@ class Controller extends BaseController
             'except' => [
                 'upload', 'getCode', 'reset', 'login', 'get', 'register', 'alipayNotify', 'wechatpayNotify', 'get', 'area', 'get_province', 'get_city', 'get_county', 'albumStyle', 'test', 'index', 'companyInfo', 'shop2', 'cardIndex', 'cardUserInfo', 'cardUserProgress', 'cardUserHonor', 'cardUserProject', 'CardUserTrend', 'projectDetail', 'trendDetail', 'albumSetting', 'albumXyxLogin', 'albumCat', 'albumchecklogin', 'albumGoods', 'albumGoodsDetail', 'albumSetPrice', 'albumXcxLogin', 'albumContentList', 'albumSearchGoods','albumContentDetail','albumFavoriteList','albumAddFavorite','albumFavoriteDel','getAttr','getOrder','getProgress','getReviewCount', 'furnitureNewsDetail','furnitureSetting','furnitureXcxLogin','furnitureGoodsList','serviceLogin','getFurnitureAds','getPhoneNumber','getQrcode','orderCount','searchList','printOrder','saveFormId','furnitureNewsList','getMoreComments','addToLike','albumSavePhone','albumGetStatistical','test',
                 'albumGetWatchRecord','albumSetWatch','albumGetCartOfWatch','albumSaveFormId','albumAddAgent','albumGetBanner','albumGetDataGoods','newgoods_list','newgoods_index','albumGetAgentAdress','albumSetCustomer','albumGetCustomer','albumGetDataCat','albumCustomerGoods','albumCustomerGoodsDetail','albumGetDataCatSingle','albumGetCountOfFavorite','albumGetUserInfo','albumStatistical','posterInfo','createPoster','posterDel','albumAgentPriceSet', 'getTop', 'agentCustomer'
-                , 'agentStatistical', 'albumOverview'
+                , 'agentStatistical', 'albumOverviewActive', 'albumOverviewLeft', 'albumOverviewFavorite', 'albumOverviewNew', 'agentAnalysis'
             ]
         ]);
 

+ 1 - 0
app/Models/AlbumAgentModel.php

xqd
@@ -54,6 +54,7 @@ class AlbumAgentModel extends BaseModel
         'realname',
         'get_count',
         'callCount',
+        'newCount',
         'pointCount',
         'favoriteCount',
         'share_times'

+ 235 - 5
public/apidoc/api_data.js

xqd xqd xqd xqd
@@ -2088,6 +2088,53 @@ define({ "api": [
     "groupTitle": "Boss",
     "name": "GetApiAlbum_bossGet_top"
   },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_analysis",
+    "title": "经销商分析(agent_analysis)",
+    "description": "<p>经销商分析(agent_analysis)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        {\n            \"realname\" : 释迦摩尼,\n            \"pointCount\" : 111\n            \"callCount\" : 111\n            \"favoriteCount\" : 111\n            \"get_count\" : 111\n            \"share_times\" : 111\n            \"newCount\" : 111\n        }\n    ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_analysis"
+  },
   {
     "type": "post",
     "url": "/api/album_boss/agent_customer",
@@ -2144,9 +2191,192 @@ define({ "api": [
   },
   {
     "type": "post",
-    "url": "/api/album_boss/agent_overview",
-    "title": "经销商总览(agent_overview)",
-    "description": "<p>经销商总览(agent_overview)</p>",
+    "url": "/api/album_boss/agent_overview_active",
+    "title": "经销商总览活跃客户(agent_overview_active)",
+    "description": "<p>经销商总览活跃客户(agent_overview_active)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_active"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_favorite",
+    "title": "经销商总览兴趣占比(agent_overview_favorite)",
+    "description": "<p>经销商总览兴趣占比(agent_overview_favorite)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_favorite"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_left",
+    "title": "经销商总览左侧(agent_overview_left)",
+    "description": "<p>经销商总览左侧(agent_overview_left)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_left"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_new",
+    "title": "经销商总览新增客户(agent_overview_new)",
+    "description": "<p>经销商总览新增客户(agent_overview_new)</p>",
     "group": "Boss",
     "permission": [
       {
@@ -2185,7 +2415,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        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
           "type": "json"
         }
       ]
@@ -2201,7 +2431,7 @@ define({ "api": [
     },
     "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
     "groupTitle": "Boss",
-    "name": "PostApiAlbum_bossAgent_overview"
+    "name": "PostApiAlbum_bossAgent_overview_new"
   },
   {
     "type": "post",

+ 235 - 5
public/apidoc/api_data.json

xqd xqd xqd xqd
@@ -2088,6 +2088,53 @@
     "groupTitle": "Boss",
     "name": "GetApiAlbum_bossGet_top"
   },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_analysis",
+    "title": "经销商分析(agent_analysis)",
+    "description": "<p>经销商分析(agent_analysis)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        {\n            \"realname\" : 释迦摩尼,\n            \"pointCount\" : 111\n            \"callCount\" : 111\n            \"favoriteCount\" : 111\n            \"get_count\" : 111\n            \"share_times\" : 111\n            \"newCount\" : 111\n        }\n    ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_analysis"
+  },
   {
     "type": "post",
     "url": "/api/album_boss/agent_customer",
@@ -2144,9 +2191,192 @@
   },
   {
     "type": "post",
-    "url": "/api/album_boss/agent_overview",
-    "title": "经销商总览(agent_overview)",
-    "description": "<p>经销商总览(agent_overview)</p>",
+    "url": "/api/album_boss/agent_overview_active",
+    "title": "经销商总览活跃客户(agent_overview_active)",
+    "description": "<p>经销商总览活跃客户(agent_overview_active)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_active"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_favorite",
+    "title": "经销商总览兴趣占比(agent_overview_favorite)",
+    "description": "<p>经销商总览兴趣占比(agent_overview_favorite)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_favorite"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_left",
+    "title": "经销商总览左侧(agent_overview_left)",
+    "description": "<p>经销商总览左侧(agent_overview_left)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_left"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_new",
+    "title": "经销商总览新增客户(agent_overview_new)",
+    "description": "<p>经销商总览新增客户(agent_overview_new)</p>",
     "group": "Boss",
     "permission": [
       {
@@ -2185,7 +2415,7 @@
       "examples": [
         {
           "title": "Success-Response:",
-          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
           "type": "json"
         }
       ]
@@ -2201,7 +2431,7 @@
     },
     "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
     "groupTitle": "Boss",
-    "name": "PostApiAlbum_bossAgent_overview"
+    "name": "PostApiAlbum_bossAgent_overview_new"
   },
   {
     "type": "post",

+ 1 - 1
public/apidoc/api_project.js

xqd
@@ -9,7 +9,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-04-14T07:43:32.349Z",
+    "time": "2019-04-17T02:46:19.795Z",
     "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": "2019-04-14T07:43:32.349Z",
+    "time": "2019-04-17T02:46:19.795Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 23 - 3
routes/api.php

xqd
@@ -511,9 +511,29 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'uses' => 'AlbumBossController@agentStatistical',
     ]);
 
-    $api->post('album_boss/agent_overview', [
-        'as' => 'album_boss.agent_overview',
-        'uses' => 'AlbumBossController@albumOverview',
+    $api->post('album_boss/agent_overview_active', [
+        'as' => 'album_boss.agent_overview_active',
+        'uses' => 'AlbumBossController@albumOverviewActive',
+    ]);
+
+    $api->post('album_boss/agent_overview_left', [
+        'as' => 'album_boss.agent_overview_left',
+        'uses' => 'AlbumBossController@albumOverviewLeft',
+    ]);
+
+    $api->post('album_boss/agent_overview_favorite', [
+        'as' => 'album_boss.agent_overview_favorite',
+        'uses' => 'AlbumBossController@albumOverviewFavorite',
+    ]);
+
+    $api->post('album_boss/agent_overview_new', [
+        'as' => 'album_boss.agent_overview_new',
+        'uses' => 'AlbumBossController@albumOverviewNew',
+    ]);
+
+    $api->post('album_boss/agent_analysis', [
+        'as' => 'album_boss.agent_analysis',
+        'uses' => 'AlbumBossController@agentAnalysis',
     ]);
 
 });