1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
 
namespace app\shop\controller\statistics;
 
use app\shop\controller\Controller;
use app\shop\service\statistics\ProductRankingService;
 
 
/**
 * 数据控制器
 */
class Product extends Controller
{
    /**
     * 会员数据统计
     */
    public function index()
    {
        $postData = $this->postData()["Params"];
        return $this->renderSuccess('', [
            // 商品数量占比
            'productRanking' => (new ProductRankingService())->getProductRanking($postData),
            // 商品金额占比
            'productMoneyRanking' => (new ProductRankingService())->getProductMoneyRanking($postData),
            // 商品分类占比
            'categoryRanking' => (new ProductRankingService())->getCategoryRanking($postData),
            // 会员等级占比
            'gradeRanking' => (new ProductRankingService())->getGradeRanking($postData),
        ]);
    }
 
}