<?php

namespace App\Models;

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

/**
 * @description 订单列表
 * @author  system;
 * @version    1.0
 * @date 2018-07-12 08:32:14
 *
 */
class OrderInfoModel extends BaseModel
{
    use SoftDeletes;
    /**
     * 数据表名
     *
     * @var string
     *
     */
    protected $table = 'order_info';
    /**
     * 主键
     */
    protected $primaryKey = 'id';

    //分页
    protected $perPage = PAGE_NUMS;

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

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

}