<?php
namespace App\Models;
use App\Models\BaseModel;
/**
 *  @description dfghfdhfgfghfg
 *  @author  system;
 *  @version    1.0
 *  @date 2017-06-01 05:20:51
 *
 */
class DreamInfoModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'dream_info';
    /**
    主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
                           'name',
                           'about',
                           'coin',
                           'time',
                           'get_coin',
                           'mark',
                           'status'
                          ];

    protected $hidden = ['deleted_at'];


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

    public function imgs()
    {
        return $this->hasMany('App\Models\DreamImages','dream_id');
    }

    public function img()
    {
        return $this->hasOne('App\Models\DreamImages','dream_id','id');
    }

//    系统消息
    public function systemInfo()
    {
        return $this->hasMany('App\Models\SystemInfoModel','other_id','id');
    }

}