<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 优惠券列表
 * @author  system;
 * @version    1.0
 * @date 2018-07-12 08:35:24
 *
 */
class UserCouponRelationModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'user_coupon_relation';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'coupon_id',
        'user_id',
        'status'
    ];

    public function coupon(){
        return $this->belongsTo('App\Models\CouponInfoModel','coupon_id');
    }

    public function user(){
        return $this->belongsTo('App\Models\UserInfoModel','user_id');
    }

}