<?php

namespace App\Models;

use App\Models\BaseModel;

/**
 * @description 预约管理
 * @author  system;
 * @version    1.0
 * @date 2018-07-18 01:53:05
 *
 */
class UserScheduleModel extends BaseModel
{
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'user_schedule';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

    /**
     * 可以被集体附值的表的字段
     *
     * @var string
     */
    protected $fillable = [
        'time',
        'user_id',
        'username',
        'phone',
        'store_id'
    ];

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

}