Loading app/Models/DivingGroup.php 0 → 100644 +26 −0 Changes for app/Models/DivingGroup.php: 26 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Support\Facades\DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; class DivingGroup extends Model { protected $table = 'CAR_DIVING_GROUP'; use HasFactory; public function getDivers(){ $registrations = DivingSignUpModel::where('DS_CODE', $this->DS_CODE)->where('DG_NUMBER', $this->DG_NUMBER)->get(); $divers = []; foreach($registrations as $registration){ $divers[] = User::find($registration->US_ID); } return $divers; } } app/Models/DivingSession.php +3 −0 Changes for app/Models/DivingSession.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -37,4 +37,7 @@ public function disable() $this->DS_ACTIVE = 0; $this->save(); } public function getDivingGroups(){ return DivingGroup::where('DS_CODE', $this->DS_CODE)->get(); } } app/Models/DivingSignUpModel.php +3 −4 Changes for app/Models/DivingSignUpModel.php: 3 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -7,9 +7,8 @@ class DivingSignUpModel extends Model { protected $table = 'CAR_REGISTRATION'; protected $primaryKey = ['us_id', 'ds_code']; protected $keyType = ['int', 'string']; protected $fillable = ['US_ID', 'DS_CODE', 'REG_ACTIVE']; protected $table = 'car_registration'; protected $fillable = ['US_ID', 'DS_CODE']; use HasFactory; } server.php +1 −1 Changes for server.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -18,4 +18,4 @@ return false; } require_once __DIR__.'/index.php'; require_once __DIR__.'/public/index.php'; Loading
app/Models/DivingGroup.php 0 → 100644 +26 −0 Changes for app/Models/DivingGroup.php: 26 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Support\Facades\DB; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Factories\HasFactory; class DivingGroup extends Model { protected $table = 'CAR_DIVING_GROUP'; use HasFactory; public function getDivers(){ $registrations = DivingSignUpModel::where('DS_CODE', $this->DS_CODE)->where('DG_NUMBER', $this->DG_NUMBER)->get(); $divers = []; foreach($registrations as $registration){ $divers[] = User::find($registration->US_ID); } return $divers; } }
app/Models/DivingSession.php +3 −0 Changes for app/Models/DivingSession.php: 3 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -37,4 +37,7 @@ public function disable() $this->DS_ACTIVE = 0; $this->save(); } public function getDivingGroups(){ return DivingGroup::where('DS_CODE', $this->DS_CODE)->get(); } }
app/Models/DivingSignUpModel.php +3 −4 Changes for app/Models/DivingSignUpModel.php: 3 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -7,9 +7,8 @@ class DivingSignUpModel extends Model { protected $table = 'CAR_REGISTRATION'; protected $primaryKey = ['us_id', 'ds_code']; protected $keyType = ['int', 'string']; protected $fillable = ['US_ID', 'DS_CODE', 'REG_ACTIVE']; protected $table = 'car_registration'; protected $fillable = ['US_ID', 'DS_CODE']; use HasFactory; }
server.php +1 −1 Changes for server.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -18,4 +18,4 @@ return false; } require_once __DIR__.'/index.php'; require_once __DIR__.'/public/index.php';