shish před 4 roky
rodič
revize
2649be9366

+ 2 - 2
biz-hd/stat/classes/StatVisitClass.php

@@ -77,9 +77,9 @@ class StatVisitClass extends BaseClass
             $year = date('Y', $timestamp);
             $month = date('m', $timestamp);
         }
-        $stat = self::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $time], true);
+        $stat = StatVisitMonthClass::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $time], true);
         if (empty($stat)) {
-            $stat = self::add(['shopId' => $shopId, 'sjId' => $sjId, 'time' => $time, 'year' => $year, 'month' => $month, 'createTime' => date("Y-m-d H:i:s")], true);
+            $stat = StatVisitMonthClass::add(['shopId' => $shopId, 'sjId' => $sjId, 'time' => $time, 'year' => $year, 'month' => $month, 'createTime' => date("Y-m-d H:i:s")], true);
         }
         $currentNum = bcadd($stat->riseNum, $visitNum);
         $stat->riseNum = $currentNum;

+ 12 - 0
biz-hd/stat/classes/StatVisitMonthClass.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace bizHd\stat\classes;
+
+use bizHd\base\classes\BaseClass;
+
+class StatVisitMonthClass extends BaseClass
+{
+
+    public static $baseFile = '\bizHd\stat\models\StatVisitMonth';
+
+}

+ 13 - 0
biz-hd/stat/models/StatVisitMonth.php

@@ -0,0 +1,13 @@
+<?php
+namespace bizHd\stat\models;
+use bizHd\base\models\Base;
+
+class StatVisitMonth extends Base
+{
+
+	public static function tableName()
+	{
+		return 'xhStatVisitMonth';
+	}
+
+}