Просмотр исходного кода

Fixed Coupon end date to be end of the day

BrettonYe 1 год назад
Родитель
Сommit
720ed60935
2 измененных файлов с 3 добавлено и 1 удалено
  1. 1 1
      app/Casts/datestamp.php
  2. 2 0
      app/Http/Controllers/Admin/CouponController.php

+ 1 - 1
app/Casts/datestamp.php

@@ -14,7 +14,7 @@ class datestamp implements CastsAttributes
      */
     public function get(Model $model, string $key, mixed $value, array $attributes): string
     {
-        return date('Y-m-d', $value);
+        return date('Y-m-d H:i:s', $value);
     }
 
     /**

+ 2 - 0
app/Http/Controllers/Admin/CouponController.php

@@ -64,6 +64,8 @@ class CouponController extends Controller
         }
         $num = (int) $request->input('num');
         $data = $request->only(['name', 'type', 'priority', 'usable_times', 'value', 'start_time', 'end_time']);
+        $data['end_time'] .= ' 23:59:59';
+
         $data['limit'] = [
             'minimum' => $request->input('minimum'),
             'used' => $request->input('used'),