| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  | <?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 | 
					
						
							| 
									
										
										
										
											2020-08-14 16:14:49 +00:00
										 |  |  |  * @property int $nombre_utilisateurs | 
					
						
							| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  |  * @property int $id_createur | 
					
						
							|  |  |  |  * @property Carbon $date_creation | 
					
						
							|  |  |  |  * @property Carbon $date_activation | 
					
						
							| 
									
										
										
										
											2020-08-14 16:14:49 +00:00
										 |  |  |  * @property int deleted | 
					
						
							| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @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', | 
					
						
							| 
									
										
										
										
											2020-08-14 16:14:49 +00:00
										 |  |  |         'nombre_utilisateurs' => 'int', | 
					
						
							|  |  |  |         'id_createur' => 'int', | 
					
						
							|  |  |  |         'deleted' => 'int' | 
					
						
							| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     protected $dates = [ | 
					
						
							|  |  |  |         'date_creation', | 
					
						
							|  |  |  |         'date_activation' | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     protected $fillable = [ | 
					
						
							|  |  |  |         'code_groupe', | 
					
						
							|  |  |  |         'nom', | 
					
						
							|  |  |  |         'limite_credit', | 
					
						
							|  |  |  |         'id_sponsor1', | 
					
						
							|  |  |  |         'id_sponsor2', | 
					
						
							|  |  |  |         'id_sponsor3', | 
					
						
							|  |  |  |         'nombre_validation', | 
					
						
							|  |  |  |         'actif', | 
					
						
							| 
									
										
										
										
											2020-08-14 16:14:49 +00:00
										 |  |  |         'nombre_utilisateurs', | 
					
						
							| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  |         'id_createur', | 
					
						
							|  |  |  |         'date_creation', | 
					
						
							| 
									
										
										
										
											2020-08-14 16:14:49 +00:00
										 |  |  |         'date_activation', | 
					
						
							|  |  |  |         'deleted' | 
					
						
							| 
									
										
										
										
											2020-08-03 07:42:28 +00:00
										 |  |  |     ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     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'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |