| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- namespace shop\controllers;
- use common\components\dateUtil;
- use Yii;
- use common\components\util;
- class StatController extends BaseController
- {
-
- //统计列表 shish 2020.1.5
- public function actionList()
- {
- $type = Yii::$app->request->get('type', 1);
- $incomeStat = [
- 'total' => (185 + 381 + 662 + 443),
- 'list' => [
- ['name' => '2.6', 'num' => 185],
- ['name' => '2.7', 'num' => 381],
- ['name' => '2.8', 'num' => 662],
- ['name' => '2.9', 'num' => 443],
- ],
- ];
- $visitStat = [
- 'total' => (115 + 341 + 622 + 423),
- 'list' => [
- ['name' => '2.6', 'num' => 115],
- ['name' => '2.7', 'num' => 341],
- ['name' => '2.8', 'num' => 622],
- ['name' => '2.9', 'num' => 423],
- ],
- ];
- $userStat = [
- 'total' => (185 + 341 + 622 + 423),
- 'list' => [
- ['name' => '2.6', 'num' => 185],
- ['name' => '2.7', 'num' => 341],
- ['name' => '2.8', 'num' => 622],
- ['name' => '2.9', 'num' => 423],
- ],
- ];
- $fansStat = [
- 'total' => (185 + 241 + 322 + 553),
- 'list' => [
- ['name' => '2.6', 'num' => 185],
- ['name' => '2.7', 'num' => 241],
- ['name' => '2.8', 'num' => 322],
- ['name' => '2.9', 'num' => 553],
- ],
- ];
- $incomeSourceStat = [
- 'total' => (299 + 366 + 2995),
- 'list' => [
- ['name' => '门店', 'num' => 299],
- ['name' => '微信朋友圈', 'num' => 366],
- ['name' => '美团', 'num' => 2995],
- ],
- ];
- $categoryStat = [
- 'total' => (552 + 155 + 295 + 365 + 600 + 504),
- 'list' => [
- ['name' => '花束', 'num' => 552],
- ['name' => '花篮', 'num' => 155],
- ['name' => '蝴蝶兰', 'num' => 295],
- ['name' => '绿植', 'num' => 365],
- ['name' => '永生花', 'num' => 600],
- ['name' => '散花', 'num' => 504],
- ],
- ];
- $useStat = [
- 'total' => (552 + 155 + 295 + 365 + 600 + 504),
- 'list' => [
- ['name' => '年销花', 'num' => 552],
- ['name' => '送爱人', 'num' => 155],
- ['name' => '婚庆', 'num' => 295],
- ['name' => '开业', 'num' => 365],
- ['name' => '送母亲', 'num' => 600],
- ['name' => '生日', 'num' => 504],
- ]
- ];
- $data = ['incomeStat' => $incomeStat,
- 'visitStat' => $visitStat,
- 'userStat' => $userStat,
- 'fansStat' => $fansStat,
- 'incomeSourceStat' => $incomeSourceStat,
- 'categoryStat' => $categoryStat,
- 'useStat' => $useStat,
- ];
- util::success($data);
- }
-
- }
|