-1) $list = $list->where('is_chapter', $is_chapter); if ($is_out > -1) $list = $list->where('is_out', $is_out); return $list->get(); } /** * 按日期删除记录 * @param $day * @param int $is_chapter * @param int $is_out * @return mixed */ public static function deleteRecordByDay($day, $is_chapter = -1, $is_out = -1) { $list = self::where('day', $day); if ($is_chapter > -1) $list = $list->where('is_chapter', $is_chapter); if ($is_out > -1) $list = $list->where('is_out', $is_out); return $list->delete(); } /** * @param $array */ public static function insertRecord($array) { self::insert($array); } /** * 查询时间段内的记录 * @param $dateStart * @param $dateEnd * @return mixed */ public static function getRecordByDateQuantum($dateStart, $dateEnd) { try { $list = self::where('day', '>=', $dateStart)->where('day', '<', $dateEnd)->get(); return $list; } catch (\Exception $e) { Log::info('------ 出错了'.$e->getMessage()); } } }