<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 排期设置
 * @author  system;
 * @version    1.0
 * @date 2018-07-12 08:33:09
 *
 */
class ProductScheduleModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'product_schedule';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'am_start',
        'pm_start',
        'am_end',
        'pm_end',
        'store_id',
        'interval',
        'max',
        'holiday_start',
        'holiday_end',
    ];

    public function store(){
        return (new StoreInfoModel())->find($this->store_id)?(new StoreInfoModel())->find($this->store_id)->name:$this->store_id;
    }

}