<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Pt;
use App\Models\Admin;
class ProfitLoss extends Model
{
    protected $table ='loss_warning';
    // 拒绝添加的字段
    protected $guarded = [];
    public $timestamps=false;

    public function pt(){
        return $this->hasOne(Pt::class,'id','p_id')->select('id','pt_name');
    }

    public function admin(){
        return $this->hasOne(Admin::class,'id','ser_id')->select('id','company_name');
    }
}