diff --git a/app/api/controller/Active.php b/app/api/controller/Active.php index edff93a1..8b85cf68 100644 --- a/app/api/controller/Active.php +++ b/app/api/controller/Active.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('暂无数据'); } diff --git a/app/api/controller/Data.php b/app/api/controller/Data.php index e65f8a5f..88cc26b4 100644 --- a/app/api/controller/Data.php +++ b/app/api/controller/Data.php @@ -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); } } diff --git a/app/api/service/Data.php b/app/api/service/Data.php deleted file mode 100644 index ecb39455..00000000 --- a/app/api/service/Data.php +++ /dev/null @@ -1,71 +0,0 @@ - 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 - ]; - } -} \ No newline at end of file diff --git a/app/api/service/statistics/CommissionData.php b/app/api/service/statistics/CommissionData.php new file mode 100644 index 00000000..7b75de5f --- /dev/null +++ b/app/api/service/statistics/CommissionData.php @@ -0,0 +1,16 @@ + 0, + 'noSettleTotalMoney' => 0 + ]; + } +} \ No newline at end of file diff --git a/app/api/service/statistics/Data.php b/app/api/service/statistics/Data.php new file mode 100644 index 00000000..cd583309 --- /dev/null +++ b/app/api/service/statistics/Data.php @@ -0,0 +1,46 @@ +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(); + } +} \ No newline at end of file diff --git a/app/api/service/statistics/OrderData.php b/app/api/service/statistics/OrderData.php new file mode 100644 index 00000000..ad75c1c0 --- /dev/null +++ b/app/api/service/statistics/OrderData.php @@ -0,0 +1,28 @@ + 0, + //订单数 + "orderCount" => 0, + //支持人数 + 'orderPayUser' => 0, + //订单成本金额 + 'orderCostMoney' => 0, + //预估利益 + 'orderInterest' => 0, + //付费会员数 + 'payMemberCount' => 0, + //付费分销商数 + 'payDealerCount' => 0 + ]; + } +} \ No newline at end of file diff --git a/app/api/service/statistics/RefundData.php b/app/api/service/statistics/RefundData.php new file mode 100644 index 00000000..681d8e56 --- /dev/null +++ b/app/api/service/statistics/RefundData.php @@ -0,0 +1,16 @@ + 0, + 'refundTotalMoney' => 0 + ]; + } +} \ No newline at end of file diff --git a/app/api/service/statistics/UserData.php b/app/api/service/statistics/UserData.php new file mode 100644 index 00000000..44bf0eab --- /dev/null +++ b/app/api/service/statistics/UserData.php @@ -0,0 +1,17 @@ + 0, + 'viewCount' => 0, + 'newUserCount' => 0, + ]; + } +} \ No newline at end of file