87 lines
1.7 KiB
PHP
87 lines
1.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class UsersGroup
|
|
*
|
|
* @property int $id
|
|
* @property string $code_groupe
|
|
* @property string $nom
|
|
* @property float $limite_credit
|
|
* @property int $id_sponsor1
|
|
* @property int $id_sponsor2
|
|
* @property int $id_sponsor3
|
|
* @property int $nombre_validation
|
|
* @property int $actif
|
|
* @property int $valide
|
|
* @property int $id_createur
|
|
* @property Carbon $date_creation
|
|
* @property Carbon $date_activation
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class UsersGroup extends Model
|
|
{
|
|
protected $table = 'users_groups';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'limite_credit' => 'float',
|
|
'id_sponsor1' => 'int',
|
|
'id_sponsor2' => 'int',
|
|
'id_sponsor3' => 'int',
|
|
'nombre_validation' => 'int',
|
|
'actif' => 'int',
|
|
'valide' => 'int',
|
|
'id_createur' => 'int'
|
|
];
|
|
|
|
protected $dates = [
|
|
'date_creation',
|
|
'date_activation'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'code_groupe',
|
|
'nom',
|
|
'limite_credit',
|
|
'id_sponsor1',
|
|
'id_sponsor2',
|
|
'id_sponsor3',
|
|
'nombre_validation',
|
|
'actif',
|
|
'valide',
|
|
'id_createur',
|
|
'date_creation',
|
|
'date_activation'
|
|
];
|
|
|
|
public function createur()
|
|
{
|
|
return $this->belongsTo(User::class, 'id_createur');
|
|
}
|
|
|
|
public function sponsor1()
|
|
{
|
|
return $this->belongsTo(User::class, 'id_sponsor1');
|
|
}
|
|
|
|
public function sponsor2()
|
|
{
|
|
return $this->belongsTo(User::class, 'id_sponsor2');
|
|
}
|
|
|
|
public function sponsor3()
|
|
{
|
|
return $this->belongsTo(User::class, 'id_sponsor3');
|
|
}
|
|
}
|