| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Models;
- /**
- * @property $id
- * @property $effective_betting_amount
- * @property $date
- * @property $rebate_ratio
- * @property $member_id
- * @property $status
- * @property $amount
- * @property $audited_by
- * @property $grant_time
- */
- class Rebate extends BaseModel
- {
- protected $table = 'rebates';
- protected $fillable = ['date', 'member_id', 'betting_amount', 'rebate_ratio',
- 'amount', 'status', 'first_name', 'username', 'audited_by',
- 'profit', 'huishui_percentage', 'huishui_restriction', 'huishui_amount',
- 'effective_betting_amount', 'grant_time', 'details', 'need_flow'
- ];
- protected $casts = ['details' => 'array'];
- const STATUS_WEI_FAN_YONG = 0;//未返佣
- const STATUS_FAN_YONG = 1; //已返佣
- public function member()
- {
- return $this->belongsTo(User::class, 'member_id', 'member_id')
- ->select(['id', 'member_id', 'username', 'first_name', 'admin_note', 'status', 'phone', 'visitor_id', 'register_ip']);
- }
- protected function getGrantTimeAttribute($value): string
- {
- if ($value > 0) return date('Y-m-d H:i', $value);
- return "";
- }
- }
|