dyjh пре 6 година
родитељ
комит
e8ece97adb

+ 32 - 1
app/Http/Controllers/Admin/Base/IndexController.php

xqd xqd
@@ -11,7 +11,11 @@ namespace App\Http\Controllers\Admin\Base;
 
 use App\Http\Controllers\Admin\Controller;
 use App\Models\AdminUserModel;
+use App\Models\AlbumStatisticalModel;
+use App\Models\AlbumUserModel;
+use App\Models\AlbumWatchRecord;
 use App\Models\AppInfoModel;
+use App\Models\CustomerDetailsModel;
 use App\Models\UserInfoModel;
 use Illuminate\Http\Request;
 use App\Services\Base\Tree;
@@ -41,7 +45,34 @@ class IndexController extends Controller
         return view('admin.base.index.index',compact('menus'));
     }
     function welcome() {
-        return view('admin.base.index.welcome');
+        $time = mktime(24,60,60,date('m'),date('d'),date('Y'));
+        $day = '[';
+        $count = '[';
+        for($i=15;$i>=1;$i--){
+            $startTime = $time-$i*86400;
+            $day .= "\"".date('m-d',$startTime)."\",";
+            $start_time = date('Y-m-d H:i:s',$startTime);
+            $end_time = date('Y-m-d H:i:s',$startTime+86400);
+            $num = AlbumWatchRecord::where([['store_id',$this->getStoreId()],['created_at','>=',$start_time],['created_at','<=',$end_time],['action',4]])->groupBy('open_id')->count();
+            $count .= $num.",";
+        }
+        $day = substr($day,0,strlen($day)-1).']';
+        $count = substr($count,0,strlen($count)-1).']';
+        return view('admin.base.index.welcome',['day'=>$day,'count'=>$count]);
+    }
+
+    public function getData(Request $request)
+    {
+        $data = $request->input();
+        $time = mktime(24,60,60,date('m'),date('d'),date('Y'));
+        $startTime = $time-$data['day']*86400;
+        $start_time = date('Y-m-d H:i:s',$startTime);
+        $newUser = AlbumUserModel::where([['created_at','>=',$start_time],['store_id',$this->getStoreId()]])->count();
+        $shareTimes = AlbumStatisticalModel::where([['store_id',$this->getStoreId()],['time','>=',$startTime]])->sum('share_times');
+        $favoriteTimes = AlbumStatisticalModel::where([['store_id',$this->getStoreId()],['time','>=',$startTime]])->sum('favorite_times');
+        $watchCount = AlbumWatchRecord::where([['store_id',$this->getStoreId()],['created_at','>=',$start_time]])->groupBy('open_id')->count();
+        $followCount = CustomerDetailsModel::where([['store_id',$this->getStoreId()],['created_at','>=',$start_time]])->groupBy('open_id')->count();
+        return $this->api(['newUser'=>$newUser,'shareTimes'=>$shareTimes,'favoriteTimes'=>$favoriteTimes,'watchCount'=>$watchCount,'followCount'=>$followCount],0,'success');
     }
 
     function createAreaDate(){

+ 22 - 2
app/Http/Controllers/Admin/Controller.php

xqd xqd
@@ -2,9 +2,9 @@
 
 namespace App\Http\Controllers\Admin;
 
-use App\Models\AlbumWechatAppModel;
+use App\Services\Base\ErrorCode;
 use Illuminate\Routing\Controller as BaseController;
-use Request,Auth;
+use Request,Response,Auth;
 /**
  * 父控制类类
  *
@@ -193,5 +193,25 @@ abstract class Controller extends BaseController
                 </html>';
         exit($html);
     }
+    public function api($data, $code = 0, $message = '')
+    {
+        $ret = $this->genApiData($data, $code, $message);
+        $status = $code === 0 ? 200 : 400;
 
+        return Response::json($ret, $status);
+    }
+    private function genApiData($data, $code = 0, $message = '')
+    {
+        if ($code !== 0 && ErrorCode::CLIENT_WRONG_PARAMS && empty($message)) {
+            $message = ErrorCode::message($code);
+        }
+        $ret = [
+            'status' => $code == 0,
+            'status_code' => $code,
+            'message' => $message,
+            'data' => $data
+        ];
+
+        return $ret;
+    }
 }

+ 68 - 0
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd xqd
@@ -17,6 +17,7 @@ use App\Models\AlbumNewsModel;
 use App\Models\AlbumProductModel;
 use App\Models\AlbumProductPriceModel;
 use App\Models\AlbumProductStyleModel;
+use App\Models\AlbumStatisticalModel;
 use App\Models\AlbumUserModel;
 use App\Models\AlbumWatchRecord;
 use App\Models\AlbumXyxUserModel;
@@ -1284,6 +1285,18 @@ class AlbumController extends Controller
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $data = $request->input();
+        $time = mktime(0,0,0,date('m'),date('d'),date('y'));
+        $check = AlbumStatisticalModel::where([['time',$time],['store_id',$data['store_id']]])->first();
+        if($check){
+            $check->share_times ++;
+            $check->save();
+        }else{
+            $add['time'] = $time;
+            $add['store_id'] = $data['store_id'];
+            $add['share_times'] = 0;
+            $add['favorite_times'] = 1;
+            AlbumStatisticalModel::create($add);
+        }
         $select_info = ['goods_id'=>$data['product_id']];
         if($userAuth->up_agent_id!=0){
             $add_record['agent_id'] = $userAuth->up_agent_id;
@@ -2303,4 +2316,59 @@ class AlbumController extends Controller
         $user['agent_id'] = $agent_id;
         return $this->api($user,0,'success');
     }
+
+
+    /**
+     * @api {post} /api/album/statistical 记录分享次数(statistical)
+     * @apiDescription 记录分享次数(statistical)
+     * @apiGroup Album
+     * @apiPermission AUTH
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "success",
+     *     "data":[]
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumStatistical(Request $request)
+    {
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ],[
+            'store_id.required'=>'缺少商户参数',
+        ]);
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+        $store_id = $request->input('store_id');
+        $userAuth = Auth('api')->user();
+        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        $time = mktime(0,0,0,date('m'),date('d'),date('y'));
+        $check = AlbumStatisticalModel::where([['time',$time],['store_id',$store_id]])->first();
+        if($check){
+            $check->share_times ++;
+            $check->save();
+        }else{
+            $add['time'] = $time;
+            $add['store_id'] = $store_id;
+            $add['share_times'] = 1;
+            $add['favorite_times'] = 0;
+            AlbumStatisticalModel::create($add);
+        }
+        return $this->api([],0,'success');
+    }
 }

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

xqd
@@ -22,7 +22,7 @@ class Controller extends BaseController
         $this->middleware('auth:api', [
             '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',
-                'albumGetWatchRecord','albumSetWatch','albumGetCartOfWatch','albumSaveFormId','albumAddAgent','albumGetBanner','albumGetDataGoods','newgoods_list','newgoods_index','albumGetAgentAdress','albumSetCustomer','albumGetCustomer','albumGetDataCat','albumCustomerGoods','albumCustomerGoodsDetail','albumGetDataCatSingle','albumGetCountOfFavorite','albumGetUserInfo'
+                'albumGetWatchRecord','albumSetWatch','albumGetCartOfWatch','albumSaveFormId','albumAddAgent','albumGetBanner','albumGetDataGoods','newgoods_list','newgoods_index','albumGetAgentAdress','albumSetCustomer','albumGetCustomer','albumGetDataCat','albumCustomerGoods','albumCustomerGoodsDetail','albumGetDataCatSingle','albumGetCountOfFavorite','albumGetUserInfo','albumStatistical'
             ]
         ]);
 

+ 4 - 2
app/Http/Controllers/Api/V1/FurnitureController.php

xqd
@@ -1096,11 +1096,13 @@ class FurnitureController extends Controller
             $save['wechat_open_id'] = $openid;
             AlbumUserModel::where('wechat_union_id',$decryptedData['unionId'])->update($save);
         }
-
+        $conf = AlbumManufacturerModel::where('store_id',$request->get('store_id'))->first();
+        $getPhone = $conf->getPhone;
+        $getFocus = $conf->getFocus;
         if (Auth::loginUsingId($userinfo->id)) {
             $user = Auth::user();
             $token = $user->createToken($user->id . '-' . $user->openid)->accessToken;
-            return $this->api(compact('token', 'user', 'session_key'));
+            return $this->api(compact('token', 'user', 'session_key','getFocus'));
         } else {
 
             return $this->error(ErrorCode::INCORRECT_USER_OR_PASS);

+ 45 - 0
app/Models/AlbumStatisticalModel.php

xqd
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: 思维定制
+ * Date: 2019/2/18
+ * Time: 13:47
+ */
+
+namespace App\Models;
+
+
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+class AlbumStatisticalModel extends BaseModel
+{
+    use SoftDeletes;
+    protected $dates = ['delete_at'];
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'album_statistical';
+    /**
+    主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+        'store_id',
+        'share_times',
+        'favorite_times',
+        'time',
+    ];
+
+}

+ 36 - 0
database/migrations/2019_02_18_112723_create_table_album_statistical.php

xqd
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateTableAlbumStatistical extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('album_statistical', function (Blueprint $table) {
+            $table->increments('id');
+            $table->unsignedInteger('store_id')->comment('store_id');
+            $table->unsignedInteger('share_times')->comment('分享次数');
+            $table->unsignedInteger('favorite_times')->comment('收藏次数');
+            $table->unsignedInteger('time')->comment('行为时间戳');
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('album_statistical');
+    }
+}

+ 81 - 0
public/apidoc/api_data.js

xqd xqd
@@ -540,6 +540,40 @@ define({ "api": [
     "groupTitle": "Album",
     "name": "GetApiAlbumGetCustomer"
   },
+  {
+    "type": "get",
+    "url": "/api/album/get-user-info",
+    "title": "获取客户详细(get-user-info)",
+    "description": "<p>获取客户详细(get-user-info)</p>",
+    "group": "Album",
+    "permission": [
+      {
+        "name": "AUTH"
+      }
+    ],
+    "version": "0.1.0",
+    "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             \"username\":\n             \"is_dealer\":\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/AlbumController.php",
+    "groupTitle": "Album",
+    "name": "GetApiAlbumGetUserInfo"
+  },
   {
     "type": "get",
     "url": "/api/album/goods",
@@ -1420,6 +1454,53 @@ define({ "api": [
     "groupTitle": "Album",
     "name": "PostApiAlbumSetWatch"
   },
+  {
+    "type": "post",
+    "url": "/api/album/statistical",
+    "title": "记录分享次数(statistical)",
+    "description": "<p>记录分享次数(statistical)</p>",
+    "group": "Album",
+    "permission": [
+      {
+        "name": "AUTH"
+      }
+    ],
+    "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\": \"success\",\n    \"data\":[]\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/AlbumController.php",
+    "groupTitle": "Album",
+    "name": "PostApiAlbumStatistical"
+  },
   {
     "type": "post",
     "url": "/api/album/xyx_login",

+ 81 - 0
public/apidoc/api_data.json

xqd xqd
@@ -540,6 +540,40 @@
     "groupTitle": "Album",
     "name": "GetApiAlbumGetCustomer"
   },
+  {
+    "type": "get",
+    "url": "/api/album/get-user-info",
+    "title": "获取客户详细(get-user-info)",
+    "description": "<p>获取客户详细(get-user-info)</p>",
+    "group": "Album",
+    "permission": [
+      {
+        "name": "AUTH"
+      }
+    ],
+    "version": "0.1.0",
+    "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             \"username\":\n             \"is_dealer\":\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/AlbumController.php",
+    "groupTitle": "Album",
+    "name": "GetApiAlbumGetUserInfo"
+  },
   {
     "type": "get",
     "url": "/api/album/goods",
@@ -1420,6 +1454,53 @@
     "groupTitle": "Album",
     "name": "PostApiAlbumSetWatch"
   },
+  {
+    "type": "post",
+    "url": "/api/album/statistical",
+    "title": "记录分享次数(statistical)",
+    "description": "<p>记录分享次数(statistical)</p>",
+    "group": "Album",
+    "permission": [
+      {
+        "name": "AUTH"
+      }
+    ],
+    "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\": \"success\",\n    \"data\":[]\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/AlbumController.php",
+    "groupTitle": "Album",
+    "name": "PostApiAlbumStatistical"
+  },
   {
     "type": "post",
     "url": "/api/album/xyx_login",

+ 1 - 1
public/apidoc/api_project.js

xqd
@@ -9,7 +9,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-02-11T05:47:45.907Z",
+    "time": "2019-02-18T09:32:54.002Z",
     "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-02-11T05:47:45.907Z",
+    "time": "2019-02-18T09:32:54.002Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

Разлика између датотеке није приказан због своје велике величине
+ 5 - 0
public/base/js/vue.js


+ 1 - 1
resources/views/admin/album/manufacturer/edit.blade.php

xqd
@@ -131,7 +131,7 @@
                                         </div>
 
 
-                                    <div class="form-group" style="display: none;">
+                                    <div class="form-group">
 
                                         <label class="control-label col-sm-3">是否获取手机号</label>
 

+ 329 - 1
resources/views/admin/base/index/welcome.blade.php

xqd
@@ -1 +1,329 @@
-欢迎您~
+@extends('admin.layout')
+
+@section('content')
+    <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
+    <style>
+        .statistical {
+
+            overflow: hidden;
+
+        }
+
+
+
+        .statistical ul li {
+
+            float: left;
+
+            width: 14.4%;
+
+            margin: 0 24.5px 20px 0;
+
+            color: #ffffff;
+
+            padding: 10px 0;
+            border-radius: 3px;
+
+        }
+        .statistical ul li:LAST-CHILD {
+
+            margin-right: 0;
+
+        }
+
+
+
+        .statistical ul li header {
+
+            /*	text-indent: 10px;*/
+            text-align: center;
+
+        }
+
+
+
+        .statistical ul li p {
+
+            margin: 0;
+
+            text-align: center;
+
+            padding: 20px;
+
+            font-size: 20px;
+
+            white-space: nowrap;
+
+            text-overflow: ellipsis;
+
+            overflow: hidden;
+            color: #fff;
+            font-size: 30px;
+
+        }
+        @media ( min-width : 0px) and (max-width: 1870px) {
+
+            .statistical ul li {
+
+                width: 30%;
+
+            }
+
+        }
+        ul{
+            list-style-type: none;
+        }
+
+        .goods-state {
+
+            overflow: hidden;
+
+            text-align: center;
+
+        }
+
+
+
+        .goods-state.a-line {
+
+            /* 	padding: 46px 0; */
+
+            padding: 0 0 10px;
+
+        }
+
+
+
+        .goods-state ul, .merchants-use ul {
+
+            margin: 0;
+
+            overflow: hidden;
+
+        }
+
+
+
+        .goods-state ul li {
+
+            float: left;
+
+            width: 20%;
+
+            margin-top: 15px;
+
+            color: #999999;
+
+            cursor: pointer;
+
+        }
+
+
+
+        .goods-state.order ul li {
+
+            width: 20%;
+
+        }
+
+
+
+        .goods-state.a-line ul li {
+
+            margin: 0;
+
+        }
+
+
+
+        .goods-state ul li h4 {
+
+            font-size: 26px;
+
+            font-weight: normal;
+
+            color: #333333;
+
+            overflow: hidden;
+
+            padding: 0 10px;
+
+            white-space: nowrap;
+
+            text-overflow: ellipsis;
+
+            white-space: nowrap;
+
+        }
+        .goods-prompt, .merchants-help, .sales, .sales-ranking, .charts,
+
+        .system-config {
+
+            border: 1px solid #e3e3e3;
+
+            width: 49%;
+
+            float: left;
+
+            height: 258px;
+
+            background: #ffffff;
+
+            margin: 0 0 15px 0;
+
+        }
+
+
+
+        .goods-prompt, .charts {
+
+            width: 98%;
+
+        }
+
+
+
+        .system-config {
+
+            width: 100%;
+
+        }
+
+        .switch div{
+            float: left;
+            text-align: center;
+            line-height: 30px;
+            margin-right: 1px;
+            width: 62px;
+            background-color: #fff;
+            border: 2px solid #f3f3f4;
+        }
+        .active_switch{
+            border: 2px solid #f8ac59 !important;
+        }
+        .goods-prompt {
+
+            height: inherit;
+
+        }
+        .page-container .main-content {height: calc(100% - 51px) !important;    background: #f2f2f2 !important;}
+        .new_index_tit {height:37px; line-height:37px;}
+        .new_tit_box {border-left:5px solid #3bd98c;height:19px;font-size:16px; font-weight: bold;color:#4fa2ff;margin-top:18px;padding-left:10px;line-height:19px;}
+        .index_icon_box { height:67px;line-height:67px;}
+        .goods-state ul li{justify-content:center;display: flex;}
+        .index_info_box {width:60px;}
+    </style>
+    <div class="wrapper wrapper-content">
+        <div class="switch">
+            <div id="7">7天</div>
+            <div id="15" class="active_switch">15天</div>
+            <div id="30">30天</div>
+        </div>
+        <div style="clear: both"></div>
+        <div class="new_index_tit">
+            <div class="new_tit_box">客户统计</div>
+        </div>
+        <div class="statistical">
+            <ul>
+                <li style="width: 17%;background: linear-gradient(to top right, #d86eec, #ae67f5);border-radius: 8px;margin-right:2% !important;" class="order-amount-statistics">
+                    <header>
+                        <i class="ns-icon-base i-order-amount"></i>
+                        <span>新增客户数</span>
+                    </header>
+                    <p id="newUser" class="js-order-amount">0</p>
+                </li>
+                <li style="width: 17%;background: linear-gradient(to top right, #5facfe, #6993ff);border-radius: 8px;margin-right:2% !important;" class="focus-number-statistics">
+                    <header>
+                        <i class="ns-icon-base i-focus-number"></i>
+                        <span>浏览客户数</span>
+                    </header>
+                    <p id="watchCount" class="js-weixin-fans-count">0</p>
+                </li>
+                <li style="width: 17%;background: linear-gradient(to top right, #fe8268, #ff758f);border-radius: 8px;margin-right:2% !important;" class="goods-release-statistics">
+                    <header>
+                        <i class="ns-icon-base i-goods-release"></i>
+                        <span>被转发次数</span>
+                    </header>
+                    <p id="shareTimes" class="js-goods-release-count">0</p>
+                </li>
+                <li style="width: 17%;background: linear-gradient(to top right, #33c8c4, #1caace);border-radius: 8px;margin-right:2% !important;" class="order-total-statistics">
+                    <header>
+                        <i class="ns-icon-base i-order-total"></i>
+                        <span>客户收藏次数</span>
+                    </header>
+                    <p id="favoriteTimes" class="js-order-total">0</p>
+                </li>
+                <li style="width: 17%;background: linear-gradient(to top right, #d870ed, #af68f6);border-radius: 8px;margin-right:2% !important;" class="month-sales-statistics">
+                    <header>
+                        <i class="ns-icon-base i-month-sales"></i>
+                        <span>跟进客户数</span>
+                    </header>
+                    <p id="followCount" class="js-month-sales">0</p>
+                </li>
+            </ul>
+        </div>
+        <div class="new_index_tit">
+            <div class="new_tit_box">15天用户活跃统计</div>
+        </div>
+        <div class="goods-prompt" style="border-radius: 6px !important; width:93% !important;">
+            <div id="container" style="height: 500px"></div>
+        </div>
+    </div>
+
+    <script>
+        var dom = document.getElementById("container");
+        var myChart = echarts.init(dom);
+        var app = {};
+        var day = "{{ $day }}"
+        var count = "{{ $count }}"
+        day = day.replace(/&quot;/g,'\"');
+        day = JSON.parse(day);
+        count = JSON.parse(count);
+        console.log(day);
+        option = null;
+        option = {
+            xAxis: {
+                type: 'category',
+                boundaryGap: false,
+                data: day
+            },
+            yAxis: {
+                type: 'value'
+            },
+            series: [{
+                data: count,
+                type: 'line',
+                areaStyle: {}
+            }]
+        };
+        ;
+        if (option && typeof option === "object") {
+            myChart.setOption(option, true);
+        }
+        $('.switch div').click(function(e){
+            $('.switch div').removeAttr('class');
+            $(this).addClass('active_switch');
+            $.ajax({
+                type: 'POST',
+                url: '<?php echo U('Base/Index/getData')?>',
+                data: {
+                    day:this.id
+                },
+                dataType: 'json',
+                headers: {
+                    'X-CSRF-TOKEN': '<?php echo csrf_token(); ?>'
+                },
+                success:function (data) {
+                    $('#newUser').text(data.data.newUser);
+                    $('#watchCount').text(data.data.watchCount);
+                    $('#shareTimes').text(data.data.shareTimes);
+                    $('#favoriteTimes').text(data.data.favoriteTimes);
+                    $('#followCount').text(data.data.followCount);
+                }
+            });
+        });
+        $(document).ready(function(){
+            $('#7').click();
+        })
+    </script>
+@endsection

+ 4 - 0
routes/api.php

xqd
@@ -307,6 +307,10 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'album.set-customer',
         'uses' => 'AlbumController@albumSetCustomer',
     ]);
+    $api->post('album/statistical', [
+        'as' => 'album.statistical',
+        'uses' => 'AlbumController@albumStatistical',
+    ]);
 
     $api->post('album/get_data_cat', [
         'as' => 'album.get_data_cat',

Неке датотеке нису приказане због велике количине промена