芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/Holiday.php
'datetime', ]; public static function getHolidayByDates($startDate, $endDate) { return Holiday::select(DB::raw('DATE_FORMAT(date, "%Y-%m-%d") as holiday_date'), 'occassion') ->where('date', '>=', $startDate) ->where('date', '<=', $endDate) ->get(); } public static function checkHolidayByDate($date) { return Holiday::Where('date', $date)->first(); } public function addedBy(): BelongsTo { return $this->belongsTo(User::class, 'added_by')->withoutGlobalScope(ActiveScope::class); } public static function weekMap($format='l') { return [ Holiday::MONDAY => now()->startOfWeek(1)->translatedFormat($format), Holiday::TUESDAY => now()->startOfWeek(2)->translatedFormat($format), Holiday::WEDNESDAY => now()->startOfWeek(3)->translatedFormat($format), Holiday::THURSDAY => now()->startOfWeek(4)->translatedFormat($format), Holiday::FRIDAY => now()->startOfWeek(5)->translatedFormat($format), Holiday::SATURDAY => now()->startOfWeek(6)->translatedFormat($format), Holiday::SUNDAY => now()->startOfWeek(7)->translatedFormat($format), ]; } }