xiaobai 跟我 前天的错误一样,我给你改下代码
src\Listeners\CheckinListener.php 第102行附近,将下面替换进去
if ($constant_force) {
$sql = "select user_id, checkin_time, check_days from";
$sql .= " (select user_id, checkin_time, constant, @pre_check := IF(constant, @pre_check+1, 0) as 'check_days'";
$sql .= " from user_checkin_history, (select @pre_check :=0) init where user_id={$userID}";
$sql .= " and checkin_time > '{$start_date}' and checkin_time < '{$end_date}'";
$sql .= " ) as tmp ";
$sql .= "order by checkin_time desc limit 1";
$data = $this->db->selectOne($sql);
$constant_count = $data ? $data->check_days : 0;
} else {
$constant_count = UserCheckinHistory::where('user_id', $userID)
->where('event_id', 0)
->where('constant', 1)
->where('checkin_time', '>', $start_date)
->where('checkin_time', '<', $end_date)
->orderBy('checkin_time', 'desc')
->count();
}