<?php

namespace plugin\admin\app\model;

use plugin\admin\app\model\Base;

/**
 * @property integer $id (主键)
 * @property integer $user_id 会员ID
 * @property integer $goods_id 商品ID
 * @property string $money 购买金额
 * @property integer $pay_id 支付订单ID
 * @property integer $type 类型 1 分红产品  2定期产品 
 * @property string $bonus 分红金额
 * @property string $refund_amount 退款金额
 * @property integer $is_grant 是否完结  1未完结  2已完结
 * @property integer $expiretime 到期时间戳
 * @property string $expiredate 到期时间
 * @property string $created_at 购买时间
 * @property string $updated_at 更新时间
 */
class MyGood extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'wa_my_goods';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';



    public function goodsHasOne()
    {
        return $this->hasOne(Good::class,'id','goods_id');
    }

    public function userData()
    {
        return $this->hasOne(User::class,'id','user_id');
    }
}
