|
|
|
@ -14,7 +14,8 @@ class Coupon extends Model |
|
|
|
protected $appends = [ |
|
|
|
'full_amount_text', |
|
|
|
'discounts_text', |
|
|
|
'time_text' |
|
|
|
'time_text', |
|
|
|
'effective_time_text' |
|
|
|
]; |
|
|
|
|
|
|
|
protected $casts = [ |
|
|
|
@ -41,4 +42,9 @@ class Coupon extends Model |
|
|
|
return date("Y-m-d H:i:s",$this->attributes['usable_start_time']). ' - ' .date("Y-m-d H:i:s",$this->attributes['usable_end_time']); |
|
|
|
} |
|
|
|
|
|
|
|
public function getEffectiveTimeTextAttribute() |
|
|
|
{ |
|
|
|
return '有效期:'.date("Y-m-d",$this->attributes['usable_start_time']). ' - ' .date("Y-m-d",$this->attributes['usable_end_time']); |
|
|
|
} |
|
|
|
|
|
|
|
} |