时间记录,不是时间戳
$thismonth = date('m');
$thisyear = date('Y');
$startDay = $thisyear . '-' . $thismonth . '-1';
$endDay = $thisyear . '-' . $thismonth . '-' . date('t', strtotime($startDay)); //当月最后一天
$time1 =date('Y-m-1 H:i:s',strtotime($startDay)); //当月第一天
$time2 = date('Y-m-d H:i:s',strtotime('+24 hour',strtotime($endDay))); //下个月月第一天
$monthScore =PointLog::where([['create_time','>=',$time1],['create_time','<=',$time2]])->where('userid','=',$_COOKIE['userid'])->sum('point');