FeWo Mail, Booking Services
This commit is contained in:
parent
730832c8e1
commit
e6cc042aee
62 changed files with 1766 additions and 284 deletions
77
app/Models/BookingCompanyService.php
Normal file
77
app/Models/BookingCompanyService.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class BookingCompanyService
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $travel_company_service_id
|
||||
* @property int $booking_id
|
||||
* @property int $status
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property Booking $booking
|
||||
* @property TravelCompanyService $travel_company_service
|
||||
* @package App\Models
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereTravelCompanyServiceId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\BookingCompanyService whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class BookingCompanyService extends Model
|
||||
{
|
||||
protected $connection = 'mysql';
|
||||
|
||||
protected $table = 'booking_company_services';
|
||||
|
||||
protected $casts = [
|
||||
'travel_company_service_id' => 'int',
|
||||
'booking_id' => 'int',
|
||||
'status' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'travel_company_service_id',
|
||||
'booking_id',
|
||||
'status'
|
||||
];
|
||||
|
||||
protected $status_type = [
|
||||
0 => 'offen',
|
||||
1 => 'erledigt',
|
||||
];
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(Booking::class);
|
||||
}
|
||||
|
||||
public function travel_company_service()
|
||||
{
|
||||
return $this->belongsTo(TravelCompanyService::class);
|
||||
}
|
||||
|
||||
public static function getStatus($travel_company_service_id, $booking_id){
|
||||
$service = BookingCompanyService::where('travel_company_service_id', '=', $travel_company_service_id)
|
||||
->where('booking_id', '=', $booking_id)->first();
|
||||
|
||||
if($service){
|
||||
return $service->status;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue