| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Models;
- /**
- * @property $date
- * @property $recharge_amount
- * @property $withdrawal_amount
- * @property $status
- * @property $backflow_ratio
- * @property $member_id
- * @property $amount
- * @property $grant_time
- *
- */
- class Backflow extends BaseModel
- {
- protected $table = 'backflow';
- protected $fillable = ['date', 'member_id', 'grant_time', 'recharge_amount', 'withdrawal_amount', 'backflow_ratio', 'amount', 'status'];
- function user()
- {
- return $this->belongsTo(User::class, 'member_id', 'member_id')
- ->select(['id', 'member_id', 'username', 'first_name']);
- }
- protected function getGrantTimeAttribute($value): string
- {
- if ($value > 0) return date('Y-m-d H:i', strtotime($value));
- return "";
- }
- }
|