IQ Reisebausteine bis Gruppe
This commit is contained in:
parent
6880c7e989
commit
9baa1a6233
43 changed files with 2206 additions and 24 deletions
|
|
@ -533,7 +533,7 @@ class Booking extends Model
|
|||
|
||||
public function booking_notices()
|
||||
{
|
||||
return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('created_at', 'DESC');
|
||||
return $this->hasMany(BookingNotice::class, 'booking_id')->orderBy('updated_at', 'DESC');
|
||||
}
|
||||
|
||||
public function booking_strono()
|
||||
|
|
|
|||
107
app/Models/IQTravelGroup.php
Normal file
107
app/Models/IQTravelGroup.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Services\Util;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
/**
|
||||
* Class IQTravelGroup
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string $highlights
|
||||
* @property int $days_start
|
||||
* @property int $days_duration
|
||||
* @property int $min_persons
|
||||
* @property float $price_adult
|
||||
* @property float $price_children
|
||||
* @property int $pos
|
||||
* @property bool $active
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Collection|IQTravelGroupItem[] $i_q_travel_group_items
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class IQTravelGroup extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'i_q_travel_groups';
|
||||
|
||||
protected $casts = [
|
||||
'days_start' => 'int',
|
||||
'days_duration' => 'int',
|
||||
'min_persons' => 'int',
|
||||
'price_adult' => 'float',
|
||||
'price_children' => 'float',
|
||||
'pos' => 'int',
|
||||
'active' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'highlights',
|
||||
'days_start',
|
||||
'days_duration',
|
||||
'min_persons',
|
||||
'price_adult',
|
||||
'price_children',
|
||||
'pos',
|
||||
'active'
|
||||
];
|
||||
|
||||
public function i_q_travel_group_items()
|
||||
{
|
||||
return $this->hasMany(IQTravelGroupItem::class)->orderBy('pos', 'DESC');
|
||||
}
|
||||
|
||||
|
||||
//price_adult
|
||||
public function getPriceAdultAttribute()
|
||||
{
|
||||
return isset($this->attributes['price_adult']) ? Util::_number_format($this->attributes['price_adult']) : null;
|
||||
}
|
||||
public function setPriceAdultAttribute($value)
|
||||
{
|
||||
$this->attributes['price_adult'] = $value ? Util::_clean_float($value) : null;
|
||||
}
|
||||
public function getPriceAdultRaw()
|
||||
{
|
||||
|
||||
return isset($this->attributes['price_adult']) ? $this->attributes['price_adult'] : 0;
|
||||
}
|
||||
public function setPriceAdultRaw($value)
|
||||
{
|
||||
return $this->attributes['price_adult'] = $value;
|
||||
}
|
||||
|
||||
|
||||
//price_children
|
||||
public function getPriceChildrenAttribute()
|
||||
{
|
||||
return isset($this->attributes['price_children']) ? Util::_number_format($this->attributes['price_children']) : null;
|
||||
}
|
||||
public function setPriceChildrenAttribute($value)
|
||||
{
|
||||
$this->attributes['price_children'] = $value ? Util::_clean_float($value) : null;
|
||||
}
|
||||
public function getPriceChildrenRaw()
|
||||
{
|
||||
return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
|
||||
}
|
||||
public function setPriceChildrenRaw($value)
|
||||
{
|
||||
return $this->attributes['price_children'] = $value;
|
||||
}
|
||||
}
|
||||
55
app/Models/IQTravelGroupItem.php
Normal file
55
app/Models/IQTravelGroupItem.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class IQTravelGroupItem
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $i_q_travel_group_id
|
||||
* @property int $i_q_travel_item_id
|
||||
* @property int $pos
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property IQTravelGroup $i_q_travel_group
|
||||
* @property IQTravelItem $i_q_travel_item
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class IQTravelGroupItem extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'i_q_travel_group_items';
|
||||
|
||||
protected $casts = [
|
||||
'i_q_travel_group_id' => 'int',
|
||||
'i_q_travel_item_id' => 'int',
|
||||
'pos' => 'int',
|
||||
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'i_q_travel_group_id',
|
||||
'i_q_travel_item_id',
|
||||
'pos',
|
||||
];
|
||||
|
||||
public function i_q_travel_group()
|
||||
{
|
||||
return $this->belongsTo(IQTravelGroup::class);
|
||||
}
|
||||
|
||||
public function i_q_travel_item()
|
||||
{
|
||||
return $this->belongsTo(IQTravelItem::class);
|
||||
}
|
||||
}
|
||||
131
app/Models/IQTravelItem.php
Normal file
131
app/Models/IQTravelItem.php
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Services\Util;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
/**
|
||||
* Class IQTravelItem
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property string $highlights
|
||||
* @property int $draft_type_id
|
||||
* @property int $travel_country_id
|
||||
* @property int $days_start
|
||||
* @property int $days_duration
|
||||
* @property int $min_persons
|
||||
* @property float $price_adult
|
||||
* @property float $price_children
|
||||
* @property int $pos
|
||||
* @property bool $active
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property TravelCountry $travel_country
|
||||
* @property Collection|IQTravelGroupItem[] $i_q_travel_group_items
|
||||
* @property Collection|IQTravelItemPlace[] $i_q_travel_item_places
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class IQTravelItem extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'i_q_travel_items';
|
||||
|
||||
protected $casts = [
|
||||
'draft_type_id' => 'int',
|
||||
'travel_country_id' => 'int',
|
||||
'days_start' => 'int',
|
||||
'days_duration' => 'int',
|
||||
'min_persons' => 'int',
|
||||
'price_adult' => 'float',
|
||||
'price_children' => 'float',
|
||||
'pos' => 'int',
|
||||
'active' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'highlights',
|
||||
'draft_type_id',
|
||||
'travel_country_id',
|
||||
'days_start',
|
||||
'days_duration',
|
||||
'min_persons',
|
||||
'price_adult',
|
||||
'price_children',
|
||||
'pos',
|
||||
'active'
|
||||
];
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo(TravelCountry::class);
|
||||
}
|
||||
|
||||
public function i_q_travel_group_items()
|
||||
{
|
||||
return $this->hasMany(IQTravelGroupItem::class);
|
||||
}
|
||||
|
||||
public function i_q_travel_item_places()
|
||||
{
|
||||
return $this->hasMany(IQTravelItemPlace::class)->orderBy('pos', 'DESC');
|
||||
}
|
||||
|
||||
public function draft_type()
|
||||
{
|
||||
return $this->belongsTo(DraftType::class, 'draft_type_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
//price_adult
|
||||
public function getPriceAdultAttribute()
|
||||
{
|
||||
return isset($this->attributes['price_adult']) ? Util::_number_format($this->attributes['price_adult']) : null;
|
||||
}
|
||||
public function setPriceAdultAttribute($value)
|
||||
{
|
||||
$this->attributes['price_adult'] = $value ? Util::_clean_float($value) : null;
|
||||
}
|
||||
public function getPriceAdultRaw()
|
||||
{
|
||||
|
||||
return isset($this->attributes['price_adult']) ? $this->attributes['price_adult'] : 0;
|
||||
}
|
||||
public function setPriceAdultRaw($value)
|
||||
{
|
||||
return $this->attributes['price_adult'] = $value;
|
||||
}
|
||||
|
||||
|
||||
//price_children
|
||||
public function getPriceChildrenAttribute()
|
||||
{
|
||||
return isset($this->attributes['price_children']) ? Util::_number_format($this->attributes['price_children']) : null;
|
||||
}
|
||||
public function setPriceChildrenAttribute($value)
|
||||
{
|
||||
$this->attributes['price_children'] = $value ? Util::_clean_float($value) : null;
|
||||
}
|
||||
public function getPriceChildrenRaw()
|
||||
{
|
||||
return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
|
||||
}
|
||||
public function setPriceChildrenRaw($value)
|
||||
{
|
||||
return $this->attributes['price_children'] = $value;
|
||||
}
|
||||
}
|
||||
54
app/Models/IQTravelItemPlace.php
Normal file
54
app/Models/IQTravelItemPlace.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class IQTravelItemPlace
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $i_q_travel_item_id
|
||||
* @property int $travel_place_id
|
||||
* @property int $pos
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property IQTravelItem $i_q_travel_item
|
||||
* @property TravelPlace $travel_place
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class IQTravelItemPlace extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'i_q_travel_item_places';
|
||||
|
||||
protected $casts = [
|
||||
'i_q_travel_item_id' => 'int',
|
||||
'travel_place_id' => 'int',
|
||||
'pos' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'i_q_travel_item_id',
|
||||
'travel_place_id',
|
||||
'pos',
|
||||
];
|
||||
|
||||
public function i_q_travel_item()
|
||||
{
|
||||
return $this->belongsTo(IQTravelItem::class);
|
||||
}
|
||||
|
||||
public function travel_place()
|
||||
{
|
||||
return $this->belongsTo(TravelPlace::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -277,7 +277,7 @@ class Lead extends Model
|
|||
|
||||
public function lead_notices()
|
||||
{
|
||||
return $this->hasMany(LeadNotice::class, 'lead_id')->orderBy('created_at', 'DESC');
|
||||
return $this->hasMany(LeadNotice::class, 'lead_id')->orderBy('updated_at', 'DESC');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class TravelCountry extends Model
|
|||
public function getContactLandsModels(){
|
||||
$ret = [];
|
||||
if($this->contact_lands){
|
||||
foreach ($this->contact_lands as $travel_country_id){
|
||||
foreach ($this->contact_lands as $contact_land_id){
|
||||
if($travel_country = TravelCountry::where('crm_id', $contact_land_id)->first()){
|
||||
$ret[$travel_country->id] = $travel_country;
|
||||
}
|
||||
|
|
|
|||
54
app/Models/TravelPlace.php
Normal file
54
app/Models/TravelPlace.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TravelPlace
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $description
|
||||
* @property int $travel_country_id
|
||||
* @property float $latitude
|
||||
* @property float $longitude
|
||||
* @property bool $active
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property TravelCountry $travel_country
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class TravelPlace extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
protected $table = 'travel_places';
|
||||
|
||||
protected $casts = [
|
||||
'travel_country_id' => 'int',
|
||||
'latitude' => 'float',
|
||||
'longitude' => 'float',
|
||||
'active' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'description',
|
||||
'travel_country_id',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'active'
|
||||
];
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo(TravelCountry::class);
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ class TravelUserBookingFewo extends Model
|
|||
|
||||
public function booking_fewo_notices()
|
||||
{
|
||||
return $this->hasMany(TravelUserBookingFewoNotice::class, 'travel_user_booking_fewo_id')->orderBy('created_at', 'DESC');
|
||||
return $this->hasMany(TravelUserBookingFewoNotice::class, 'travel_user_booking_fewo_id')->orderBy('updated_at', 'DESC');
|
||||
}
|
||||
|
||||
public function getStatuesName(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue