<?php

namespace App\Models;
class WalletBonus extends BaseModel
{
    protected $table = 'wallet_bonus';
    protected $fillable = ['member_id','activity_id','related_id','amount','need_flow','remaind_flow','status'];

    public static function addData($memberId, $type, $bonusAmount, $activityId, $related_id, $need_flow)
    {
        $data = [
            'member_id' => $memberId,
            'type' => $type,    //类型1充值活动返彩;2余额宝收益；3老用户回归日充值返彩 
            'activity_id' => $activityId,
            'related_id' => $related_id,
            'amount' => $bonusAmount,
            'need_flow' => $need_flow,
            'remaind_flow' => $need_flow,
            'status' => 1,
        ];
        self::create($data);
    }
}
