| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace App\Models;
- use App\Constants\Util;
- /**
- * @property string $activity_id
- * @property string $finish_time
- * @property string member_id
- * @property string title
- * @property string status
- * @property string sub_title
- * @property string detail_image
- * @property string start_time
- * @property string end_time
- * @property string part_in_time
- *
- */
- class ActivityUser extends BaseModel
- {
- protected $table = 'activity_user';
- protected $fillable = ['activity_id', 'finish_time', 'member_id', 'title', 'status', 'sub_title', 'detail_image',
- 'start_time', 'end_time', 'part_in_time'];
- protected function getDetailImageAttribute($value)
- {
- return Util::ensureUrl($value);
- }
- protected function getPartInTimeAttribute($value): string
- {
- return date('Y-m-d H:i:s', $value);
- }
- protected function getFinishTimeAttribute($value): string
- {
- if ($value > 1) {
- return date('Y-m-d', $value);
- }
- return "";
- }
- protected function getStartTimeAttribute($value): string
- {
- return date('Y-m-d', $value);
- }
- protected function getEndTimeAttribute($value): string
- {
- return date('Y-m-d', $value);
- }
- }
|