Răsfoiți Sursa

最近30天

shish 5 ani în urmă
părinte
comite
fcb82f52d4

+ 16 - 12
app-ghs/controllers/ConsoleController.php

@@ -11,6 +11,7 @@ use bizHd\stat\services\StatOrderService;
 use bizHd\stat\services\StatUserService;
 use bizHd\stat\services\StatVisitService;
 use common\components\dict;
+use common\components\httpUtil;
 use Yii;
 use common\components\util;
 
@@ -53,18 +54,21 @@ class ConsoleController extends BaseController
             ['name' => '全部', 'img' => 'https://img.huaml.com/retail/admin/tab-icon-6.png', 'page' => '/pageA/merchant/getList'],
         ];
 
-        //当月的收入
-        $currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->shopId);
-        //上个月收入
-        $previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->shopId);
-        //最近7天收入变化趋势
-        $latestIncome = StatIncomeService::getLatestSevenDay($this->shopId);
-        $incomeStat = [
-            'month' => $currentMonthIncome,
-            'week' => 999,
-            'previousMonth' => $previousMonthIncome,
-            'list' => $latestIncome,
-        ];
+        $incomeStat = [];
+        if(httpUtil::isMiniProgram() == false){
+            //当月的收入
+            $currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->shopId);
+            //上个月收入
+            $previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->shopId);
+            //最近7天收入变化趋势
+            $latestIncome = StatIncomeService::getLatestSevenDay($this->shopId);
+            $incomeStat = [
+                'month' => $currentMonthIncome,
+                'week' => 999,
+                'previousMonth' => $previousMonthIncome,
+                'list' => $latestIncome,
+            ];
+        }
 
         util::success([
             'asset' => $asset,

+ 17 - 12
app-hd/controllers/ConsoleController.php

@@ -9,6 +9,7 @@ use bizHd\stat\services\StatOrderService;
 use bizHd\stat\services\StatUserService;
 use bizHd\stat\services\StatVisitService;
 use common\components\dict;
+use common\components\httpUtil;
 use common\components\util;
 
 class ConsoleController extends BaseController
@@ -50,18 +51,22 @@ class ConsoleController extends BaseController
         $todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
         $todayData = ['visit' => $todayVisit, 'fans' => $todayFansNum, 'user' => $todayUserNum, 'income' => $todayIncome, 'order' => $todayOrder];
 
-        //当月的收入
-        $currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->sjId);
-        //上个月收入
-        $previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->sjId);
-        //最近7天收入变化趋势
-        $latestIncome = StatIncomeService::getLatestSevenDay($this->sjId);
-        $incomeStat = [
-            'month' => $currentMonthIncome,
-            'week' => 999,
-            'previousMonth' => $previousMonthIncome,
-            'list' => $latestIncome,
-        ];
+        $incomeStat = [];
+        if(httpUtil::isMiniProgram() == false){
+            //当月的收入
+            $currentMonthIncome = StatIncomeMonthService::getCurrentMonthIncome($this->shopId);
+            //上个月收入
+            $previousMonthIncome = StatIncomeMonthService::getPreviousMonthIncome($this->shopId);
+            //最近7天收入变化趋势
+            $latestIncome = StatIncomeService::getLatestSevenDay($this->shopId);
+            $incomeStat = [
+                'month' => $currentMonthIncome,
+                'week' => 999,
+                'previousMonth' => $previousMonthIncome,
+                'list' => $latestIncome,
+            ];
+        }
+
         $visitStat = [
             'month' => 1999,
             'week' => 999,

+ 1 - 1
biz-hd/stat/services/StatIncomeService.php

@@ -44,7 +44,7 @@ class StatIncomeService extends BaseService
 	//最近7天收入情况 ssh 2020.2.2
 	public static function getLatestSevenDay($shopId)
 	{
-		$return = dateUtil::getDate(1);
+		$return = dateUtil::getDate(2);
 		$start = $return[0];
 		$end = $return[1];
 		$list = self::getLatestIncome($start, $end, $shopId);