- API contratos activos (cliente y proveedor): agrega campo profile_photo (técnico asignado o supplier, null si no tiene) - Notificaciones push bilingues en comentarios de reporte: "Nueva actividad en tu reporte" / "New activity on your report" - Moderador en web panel notifica a cliente y proveedor al comentar, con prefijo Moderador/Moderator - Panel usuarios: columna de foto de perfil entre ID y Nombre Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
87 lines
1.8 KiB
PHP
Executable File
87 lines
1.8 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\User;
|
|
use App\Models\iChambaParameter;
|
|
use App\Models\Banks;
|
|
use App\Models\Categories;
|
|
use App\Models\Postulations;
|
|
use App\Models\FinishedContracts;
|
|
use App\Models\CurrentContracts;
|
|
use App\Models\Payments;
|
|
use App\Models\Technician;
|
|
use TarfinLabs\LaravelSpatial\Casts\LocationCast;
|
|
use TarfinLabs\LaravelSpatial\Traits\HasSpatial;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Suppliers extends Model
|
|
{
|
|
use HasSpatial;
|
|
|
|
protected $fillable = [
|
|
'company_name',
|
|
'membership',
|
|
'cover_photo',
|
|
'tags',
|
|
'RFC',
|
|
'CURP',
|
|
'clabe',
|
|
'bank_id',
|
|
'IVA_id',
|
|
'ISR_id',
|
|
'finished_jobs',
|
|
'total_score',
|
|
'address',
|
|
];
|
|
|
|
protected $casts = [
|
|
'location' => LocationCast::class
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function banks()
|
|
{
|
|
return $this->belongsTo('App\Models\Banks', 'bank_id');
|
|
}
|
|
|
|
public function categories()
|
|
{
|
|
return $this->belongsToMany(Categories::class);
|
|
}
|
|
|
|
public function postulations()
|
|
{
|
|
return $this->belongsToMany(Postulations::class, 'postulations_suppliers', 'suppliers_id', 'postulations_id')->withTimestamps();
|
|
}
|
|
|
|
public function payments()
|
|
{
|
|
return $this->hasMany(Payments::class);
|
|
}
|
|
|
|
public function currentcontracts()
|
|
{
|
|
return $this->hasMany(CurrentContracts::class);
|
|
}
|
|
|
|
public function finishedcontracts()
|
|
{
|
|
return $this->hasMany(FinishedContracts::class);
|
|
}
|
|
|
|
public function technicians()
|
|
{
|
|
return $this->hasMany(Technician::class, 'supplier_id');
|
|
}
|
|
|
|
public function ichambaparameters()
|
|
{
|
|
return $this->belongsTo(iChambaParameter::class);
|
|
}
|
|
}
|