|
|
@@ -25,10 +25,10 @@ class StatRefundMonthClass extends BaseClass
|
|
|
$month = date('m', $timestamp);
|
|
|
}
|
|
|
$sjId = $shop->sjId;
|
|
|
- $shopId = $shop->id;
|
|
|
- $stat = self::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $time], true);
|
|
|
+ $mainId = $main->id ?? 0;
|
|
|
+ $stat = self::getByCondition(['sjId' => $sjId, 'mainId' => $mainId, 'time' => $time], true);
|
|
|
if (empty($stat)) {
|
|
|
- $stat = self::add(['shopId' => $shopId, 'sjId' => $sjId, 'time' => $time, 'year' => $year, 'month' => $month, 'num' => 1], true);
|
|
|
+ $stat = self::add(['mainId' => $mainId, 'sjId' => $sjId, 'time' => $time, 'year' => $year, 'month' => $month, 'num' => 1], true);
|
|
|
}
|
|
|
$id = $stat->id;
|
|
|
$unique = self::getLockById($id);
|