<?php

namespace App\Models;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * @description 产品列表
 * @author  system;
 * @version    1.0
 * @date 2018-07-12 08:28:48
 *
 */
class ProductCategoryModel extends BaseModel
{
    use SoftDeletes;
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'product_category';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

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

    public function spec(){
        return $this->hasMany('App\Models\ProductInfoModel','category_id','id');
    }

}