NASER dynamic close hour
This commit is contained in:
@@ -113,17 +113,19 @@ class ReportController extends Controller
|
||||
{
|
||||
$closed = false;
|
||||
|
||||
// if(auth('customer')->id() == 525){dd($close_setting->is_active == '1');}
|
||||
|
||||
if($this->Config('close_price') == 'true'){
|
||||
$startDay = $this->Config('startDay'); // خروجی: "11:00"
|
||||
[$startHour, $startMinute] = explode(':', $startDay);
|
||||
|
||||
$endDay = $this->Config('endDay'); // خروجی: "11:00"
|
||||
[$endHour, $endMinute] = explode(':', $endDay);
|
||||
|
||||
$current = Carbon::now();
|
||||
$start = Carbon::today()->setTime(11, 0);
|
||||
$end = Carbon::today()->setTime(20, 0);
|
||||
// if(auth('customer')->id() == 525){dd("2026-05-08 23:00:00" >= $start && "2026-05-08 23:00:00" <= $end);}
|
||||
$start = Carbon::today()->setTime((int)$startHour, (int)$startMinute);
|
||||
$end = Carbon::today()->setTime((int)$endHour, (int)$endMinute);
|
||||
|
||||
if(!$current->between($start, $end)){
|
||||
|
||||
// $closed = true;
|
||||
Cnt::where('key', 'app_closed')->update(['value' => "true"]);
|
||||
Cnt::where('key', 'goldir_closed')->update(['value' => "true"]);
|
||||
$liman_price = 0;
|
||||
@@ -143,7 +145,7 @@ class ReportController extends Controller
|
||||
Cnt::where('key', 'goldir_closed')->update(['value' => "false"]);
|
||||
}
|
||||
}
|
||||
// $difference = config('fee.single');
|
||||
|
||||
$settings = Setting::whereIn('key', ['fee_single', 'goldir_price', 'tabanGohar_price', 'main_product_price'])->get();
|
||||
$settingsMap = $settings->pluck('value', 'key');
|
||||
$taban_gohar_price = $settingsMap->get('tabanGohar_price');
|
||||
|
||||
Reference in New Issue
Block a user