| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?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
- * @property $effective_betting_amount
- * @property $gift_amount
- *
- */
- 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',
- 'effective_betting_amount', 'gift_amount',
- ];
- const STATUS_APPLY = 0;
- const STATUS_IN_PROGRESS = 1;
- const STATUS_COMPLETE = 2;
- 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 H:i:s', $value);
- }
- return "";
- }
- protected function getStartTimeAttribute($value): string
- {
- return date('Y-m-d', $value);
- }
- protected function getEndTimeAttribute($value): string
- {
- return date('Y-m-d', $value);
- }
- }
|