id; $sjId = $shop->sjId; $date = isset($date) ? $date : date("Ymd"); $stat = self::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $date], true); if (empty($stat)) { $stat = self::add(['shopId' => $shopId, 'sjId' => $sjId, 'time' => $date], true); } $stat->riseNum += 1; $stat->save(); StatStudentMonthClass::addStudent($shop); } //今天的新学员数 ssh 20210524 public static function getTodayNum($shop) { $today = date("Ymd"); $shopId = $shop->id; $sjId = $shop->sjId; $new = self::getByCondition(['time' => $today, 'sjId' => $sjId, 'shopId' => $shopId], true); return $new->riseNum ?? 0; } }