<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 新品列表
 * @author  system;
 * @version    1.0
 * @date 2018-12-20 10:09:42
 *
 */
class FurnitureNewgoodsInfoModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'furniture_newgoods_info';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'title',
        'thumb',
        'content',
        'comments_field_1',
        'comments_field_2',
        'comments_field_3',
        'comments_field_4',
        'sort',
        'store_id'
    ];

    public function comments(){
        return $this->hasMany('App\Models\FurnitureNewgoodsCommentModel', 'newgoods_id');
    }
}