Переглянути джерело

Fixed Coupon end date to be end of the day

BrettonYe 1 рік тому
батько
коміт
720ed60935

+ 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'),