<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 产品管理
 * @author  system;
 * @version    1.0
 * @date 2018-07-20 11:16:25
 *
 */
class FurnitureGoodsModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'furniture_goods';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'name',
        'img',
        'goods_id',
        'sort',
        'status',
        'store_id'
    ];

    public function category(){
        return (new FurnitureGoodsCategoryModel())->find($this->category_id)?(new FurnitureGoodsCategoryModel())->find($this->category_id)->name:$this->category_id;
    }


}