fix trigger bug 2
This commit is contained in:
@@ -126,13 +126,17 @@ class ConditionalOrderController extends Controller
|
||||
|
||||
if (! empty($data['expires_at'])) {
|
||||
try {
|
||||
$expires = \Illuminate\Support\Carbon::parse($data['expires_at']);
|
||||
$expires = \Illuminate\Support\Carbon::parse(
|
||||
$data['expires_at'],
|
||||
config('app.timezone')
|
||||
)->timezone(config('app.timezone'));
|
||||
} catch (\Throwable $e) {
|
||||
throw new UnprocessableEntityHttpException('زمان اعتبار تاریخ معتبری نیست.');
|
||||
}
|
||||
if ($expires->lte(now())) {
|
||||
throw new UnprocessableEntityHttpException('زمان اعتبار باید بعد از الان باشد.');
|
||||
throw new UnprocessableEntityHttpException('زمان اعتبار باید بعد از تایم فعلی باشد.');
|
||||
}
|
||||
// Wall-clock in app TZ; column is DATETIME (not TIMESTAMP) to avoid double TZ shift.
|
||||
$data['expires_at'] = $expires->format('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user