|
@@ -10,16 +10,23 @@ namespace App\Models;
|
|
|
* @property $backflow_ratio
|
|
* @property $backflow_ratio
|
|
|
* @property $member_id
|
|
* @property $member_id
|
|
|
* @property $amount
|
|
* @property $amount
|
|
|
|
|
+ * @property $grant_time
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
class Backflow extends BaseModel
|
|
class Backflow extends BaseModel
|
|
|
{
|
|
{
|
|
|
protected $table = 'backflow';
|
|
protected $table = 'backflow';
|
|
|
- protected $fillable = ['date', 'member_id', 'recharge_amount', 'withdrawal_amount', 'backflow_ratio', 'amount', 'status'];
|
|
|
|
|
|
|
+ protected $fillable = ['date', 'member_id', 'grant_time', 'recharge_amount', 'withdrawal_amount', 'backflow_ratio', 'amount', 'status'];
|
|
|
|
|
|
|
|
function user()
|
|
function user()
|
|
|
{
|
|
{
|
|
|
return $this->belongsTo(User::class, 'member_id', 'member_id')
|
|
return $this->belongsTo(User::class, 'member_id', 'member_id')
|
|
|
->select(['id', 'member_id', 'username', 'first_name']);
|
|
->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 "";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|