shish 4 anos atrás
pai
commit
4418ed2b16

+ 0 - 1
biz/stat/classes/StatItemClass.php

@@ -44,7 +44,6 @@ class StatItemClass extends BaseClass
         $id = $stat->id;
         $unique = self::getLockById($id);
 
-
         $amount = $item->price ?? 0;
         $num = $item->num ?? 0;
         $currentNum = bcadd($unique->num, $num, 2);

+ 3 - 3
biz/stat/classes/StatItemMonthClass.php

@@ -51,11 +51,11 @@ class StatItemMonthClass extends BaseClass
             $month = date('m', $timestamp);
         }
         $sjId = $item->sjId ?? 0;
-        $shopId = $item->shopId ?? 0;
+        $mainId = $item->mainId ?? 0;
         $productId = $item->productId ?? 0;
-        $stat = self::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'itemId' => $productId, 'time' => $time], true);
+        $stat = self::getByCondition(['sjId' => $sjId, 'mainId' => $mainId, 'itemId' => $productId, 'time' => $time], true);
         if (empty($stat)) {
-            $stat = self::add(['shopId' => $shopId, 'sjId' => $sjId, 'itemId' => $productId, 'time' => $time, 'year' => $year, 'month' => $month], true);
+            $stat = self::add(['mainId' => $mainId, 'sjId' => $sjId, 'itemId' => $productId, 'time' => $time, 'year' => $year, 'month' => $month], true);
         }
         $id = $stat->id;
         $unique = self::getLockById($id);