<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Pt;
class Orders extends Model
{
    //指定表名
    protected $table ='orders';
    // 拒绝添加的字段
    protected $guarded = [];
    public $timestamps=false;

    public function pt(){
        return $this->hasOne(Pt::class,'id','p_id')->select('id','pt_name');
    }
    public function user(){
        return $this->hasOne(User::class,'id','customer_id')->select('id','shr_name','shr_phone','shr_sheng','shr_shi','shr_xian','shr_adress','car_make','car_line','car_model','shr_other');
    }
    public function ordermsg(){
        return $this->hasOne(OrderMsg::class,'sys_num','sys_num')->select('id','sys_num','beihuan_id','goods_name','goods_num','goods_service','goods_number','goods_price','goods_paid','goods_state','goods_difference','goods_brand');
    }
}
