|
|
@@ -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);
|