数据统计

wysf
ztt 9 months ago
parent 8cd121de65
commit a2d4d99b0c
  1. 3
      app/api/controller/Active.php
  2. 4
      app/api/controller/Data.php
  3. 71
      app/api/service/Data.php
  4. 16
      app/api/service/statistics/CommissionData.php
  5. 46
      app/api/service/statistics/Data.php
  6. 28
      app/api/service/statistics/OrderData.php
  7. 16
      app/api/service/statistics/RefundData.php
  8. 17
      app/api/service/statistics/UserData.php

@ -44,8 +44,7 @@ class Active extends Controller
public function info(): Json{
$model = new ActiveMain();
$data = $model->where('id',1)
->where('')
->field('id,name,title,index_icon')->find();
->field('id,name,title')->find();
if (!$data) {
return $this->renderSuccess('暂无数据');
}

@ -15,7 +15,7 @@ namespace app\api\controller;
use think\db\exception\ModelNotFoundException;
use think\response\Json;
use app\api\service\Data as StatisticsDataService;
use app\api\service\statistics\Data as StatisticsDataService;
/**
* 数据概况
@ -60,7 +60,7 @@ class Data extends Controller
// 佣金数据
'commissionData' => $this->service->getCommissionData($startDate, $endDate),
];
return $this->renderSuccess(compact('data'));
return $this->renderSuccess($data);
}
}

@ -1,71 +0,0 @@
<?php
namespace app\api\service;
use app\common\service\BaseService;
/**
* 数据概况服务类
* Class Data
* @package app\api\service\statistics
*/
class Data extends BaseService
{
/**
* 订单数据
* @return mixed
*/
public function getOrderData($startDate = null, $endDate = null): array {
return [
//订单金额
"orderMoney" => 0,
//订单数
"orderCount" => 0,
//支持人数
'orderPayUser' => 0,
//订单成本金额
'orderCostMoney' => 0,
//预估利益
'orderInterest' => 0,
//付费会员数
'payMemberCount' => 0,
//付费分销商数
'payDealerCount' => 0
];
}
/**
* 退款数据
* @return mixed
*/
public function getRefundData($startDate = null, $endDate = null): array {
return [
'refundCount' => 0,
'refundTotalMoney' => 0
];
}
/**
* 用户数据
* @return mixed
*/
public function getUserData($startDate = null, $endDate = null): array {
return [
'visitorCount' => 0,
'viewCount' => 0,
'newUserCount' => 0,
];
}
/**
* 佣金数据
* @return mixed
*/
public function getCommissionData($startDate = null, $endDate = null) : array{
return [
'settleTotalMoney' => 0,
'noSettleTotalMoney' => 0
];
}
}

@ -0,0 +1,16 @@
<?php
namespace app\api\service\statistics;
use app\common\service\BaseService;
class CommissionData extends BaseService
{
public function getCommissionData(): array
{
return [
'settleTotalMoney' => 0,
'noSettleTotalMoney' => 0
];
}
}

@ -0,0 +1,46 @@
<?php
namespace app\api\service\statistics;
use app\common\service\BaseService;
/**
* 数据概况服务类
* Class Data
* @package app\api\service\statistics
*/
class Data extends BaseService
{
/**
* 订单数据
* @return mixed
*/
public function getOrderData($startDate = null, $endDate = null): array {
return (new OrderData())->getOrderData();
}
/**
* 退款数据
* @return mixed
*/
public function getRefundData($startDate = null, $endDate = null): array {
return (new RefundData())->getRefundData();
}
/**
* 用户数据
* @return mixed
*/
public function getUserData($startDate = null, $endDate = null): array {
return (new UserData())->getUserData();
}
/**
* 佣金数据
* @return mixed
*/
public function getCommissionData($startDate = null, $endDate = null) : array{
return (new CommissionData())->getCommissionData();
}
}

@ -0,0 +1,28 @@
<?php
namespace app\api\service\statistics;
use app\common\service\BaseService;
class OrderData extends BaseService
{
public function getOrderData(): array
{
return [
//订单金额
"orderMoney" => 0,
//订单数
"orderCount" => 0,
//支持人数
'orderPayUser' => 0,
//订单成本金额
'orderCostMoney' => 0,
//预估利益
'orderInterest' => 0,
//付费会员数
'payMemberCount' => 0,
//付费分销商数
'payDealerCount' => 0
];
}
}

@ -0,0 +1,16 @@
<?php
namespace app\api\service\statistics;
use app\common\service\BaseService;
class RefundData extends BaseService
{
public function getRefundData(): array
{
return [
'refundCount' => 0,
'refundTotalMoney' => 0
];
}
}

@ -0,0 +1,17 @@
<?php
namespace app\api\service\statistics;
use app\common\service\BaseService;
class UserData extends BaseService
{
public function getUserData(): array
{
return [
'visitorCount' => 0,
'viewCount' => 0,
'newUserCount' => 0,
];
}
}
Loading…
Cancel
Save