林琦海 5 年之前
父節點
當前提交
28e0711276

+ 4 - 4
app-ghs/controllers/ConsoleController.php

@@ -29,17 +29,17 @@ class ConsoleController extends BaseController
         //今天访客数
         $todayVisit = StatVisitService::getTodayVisitNum($this->sjId);
         //今天客户与粉丝数
-        $userData = StatUserService::getTodayNum($this->sjId);
+        $userData = StatUserService::getTodayNum($this->shopId);
         $todayFansNum = isset($userData['riseFansNum']) ? $userData['riseFansNum'] : 0;
         $todayUserNum = isset($userData['riseUserNum']) ? $userData['riseUserNum'] : 0;
         //今天订单数
-        $orderData = StatOrderService::getTodayNum($this->sjId,$this->shopId);
+        $orderData = StatOrderService::getTodayNum($this->shopId);
         $todayOrder = isset($orderData['riseNum']) ? $orderData['riseNum'] : 0;
         //今天收入
-        $incomeData = StatIncomeService::getTodayNum($this->sjId,$this->shopId);
+        $incomeData = StatIncomeService::getTodayNum($this->shopId);
         $todayIncome = isset($incomeData['amount']) ? $incomeData['amount'] : 0;
         //2021.4.14 linqh 今日支出
-        $outData = StatOutService::getTodayNum($this->sjId,$this->shopId);
+        $outData = StatOutService::getTodayNum($this->shopId);
         $todayOut = $outData['amount']??0;
         $todayData = ['visit' => $todayVisit, 'fans' => $todayFansNum, 'user' => $todayUserNum, 'income' => $todayIncome, 'order' => $todayOrder, 'expend' => $todayOut];
 

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

@@ -14,10 +14,10 @@ class StatIncomeService extends BaseService
 	public static $baseFile = '\bizHd\stat\classes\StatIncomeClass';
 
 	//取今天的数据 ssh 2019.9.8
-	public static function getTodayNum($merchantId,$shopId)
+	public static function getTodayNum($shopId)
 	{
 		$today = date("Ymd");
-		return StatIncomeClass::getByCondition(['merchantId' => $merchantId, 'time' => $today,'shopId'=>$shopId]);
+		return StatIncomeClass::getByCondition([ 'time' => $today,'shopId'=>$shopId]);
 	}
 
 	public static function checkUp($id, $merchantId)

+ 2 - 2
biz-hd/stat/services/StatOrderService.php

@@ -11,10 +11,10 @@ class StatOrderService extends BaseService
 
     public static $baseFile = '\bizHd\stat\classes\StatOrderClass';
 
-    public static function getTodayNum($merchantId,$shopId)
+    public static function getTodayNum($shopId)
     {
         $today = date("Ymd");
-        return StatOrderClass::getByCondition(['merchantId' => $merchantId, 'time' => $today,'shopId'=>$shopId]);
+        return StatOrderClass::getByCondition(['time' => $today,'shopId'=>$shopId]);
     }
 
 }

+ 6 - 6
biz-hd/stat/services/StatUserService.php

@@ -8,13 +8,13 @@ use Yii;
 
 class StatUserService extends BaseService
 {
-	
+
 	public static $baseFile = '\bizHd\stat\classes\StatUserClass';
-	
-	public static function getTodayNum($merchantId)
+
+	public static function getTodayNum($shopId)
 	{
 		$today = date("Ymd");
-		return StatUserClass::getByCondition(['merchantId' => $merchantId, 'time' => $today]);
+		return StatUserClass::getByCondition(['shopId' => $shopId, 'time' => $today]);
 	}
-	
-}
+
+}

+ 2 - 2
biz/stat/services/StatOutService.php

@@ -14,9 +14,9 @@ class StatOutService extends BaseService
     public static $baseFile = '\biz\stat\classes\StatOutClass';
 
     //取今天的数据 linqh 2021.4.14
-    public static function getTodayNum($merchantId,$shopId)
+    public static function getTodayNum($shopId)
     {
         $today = date("Ymd");
-        return StatOutClass::getByCondition(['merchantId' => $merchantId, 'time' => $today,'shopId'=>$shopId]);
+        return StatOutClass::getByCondition([ 'time' => $today,'shopId'=>$shopId]);
     }
 }

+ 10 - 0
sql.sql

@@ -2110,4 +2110,14 @@ ADD COLUMN `totalAmount`  decimal(9,2) NOT NULL DEFAULT 0 COMMENT '总收入金
 ALTER TABLE `xhStatIncomeMonth`
 ADD COLUMN `totalAmount`  decimal(9,2) NOT NULL DEFAULT 0 COMMENT '总收入' AFTER `amount`;
 
+==============linqh 2021-04-16
+======
+ALTER TABLE `xhStatUser`
+ADD COLUMN `shopId`  int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '门店ID' AFTER `merchantId`,
+ADD INDEX `idx_shopId` (`shopId`) ;
+
+ALTER TABLE `xhStatUserMonth`
+ADD COLUMN `shopId`  int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '门店ID' AFTER `merchantId`,
+ADD INDEX `idx_shopId` (`shopId`) ;
+