'array', 'tags' => 'array' ]; public function getFullAmountTextAttribute() { return '满'.$this->attributes['full_amount'].'可用'; } public function getDiscountsTextAttribute() { if($this->attributes['discount_type'] == 1){ return '¥'.$this->attributes['discounts']; }elseif($this->attributes['discount_type'] == 2){ return floatval($this->attributes['discounts'])."折"; } } public function getTimeTextAttribute() { 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']); } }