| @@ 119-128 (lines=10) @@ | ||
| 116 | return $this->usage_limit; |
|
| 117 | } |
|
| 118 | ||
| 119 | public function getUseStartTimeAttribute() |
|
| 120 | { |
|
| 121 | if (!$this->attributes['usestart_at']) { |
|
| 122 | $time = $this->starts_at; |
|
| 123 | } else { |
|
| 124 | $time = $this->attributes['usestart_at']; |
|
| 125 | } |
|
| 126 | ||
| 127 | return date('Y-m-d', strtotime($time)); |
|
| 128 | } |
|
| 129 | ||
| 130 | public function getUseEndTimeAttribute() |
|
| 131 | { |
|
| @@ 130-139 (lines=10) @@ | ||
| 127 | return date('Y-m-d', strtotime($time)); |
|
| 128 | } |
|
| 129 | ||
| 130 | public function getUseEndTimeAttribute() |
|
| 131 | { |
|
| 132 | if (!$this->attributes['useend_at']) { |
|
| 133 | $time = $this->ends_at; |
|
| 134 | } else { |
|
| 135 | $time = $this->attributes['useend_at']; |
|
| 136 | } |
|
| 137 | ||
| 138 | return date('Y-m-d', strtotime($time)); |
|
| 139 | } |
|
| 140 | ||
| 141 | /** |
|
| 142 | * 为方便前台展示优惠券信息. |
|