first commit
This commit is contained in:
44
app/Models/ApiAccessToken.php
Normal file
44
app/Models/ApiAccessToken.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ApiAccessToken extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'api_access_token';
|
||||
protected $appends = ['expire_time'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne('App\Models\User', 'id', 'user_id');
|
||||
}
|
||||
|
||||
|
||||
public function getExpireTimeAttribute()
|
||||
{
|
||||
try {
|
||||
return date('Y-m-d H:i:s', $this->expire_date);
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
39
app/Models/AwardsCertificateCategory.php
Normal file
39
app/Models/AwardsCertificateCategory.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class AwardsCertificateCategory extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'awards_certificate_category';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function propertyAwardsCertificate()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyAwardsCertificate','category_id', 'id')
|
||||
->select('id', 'property_id', 'category_id', 'name', 'date', 'url', 'file_path', 'file_type', 'status');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
113
app/Models/BaseModel.php
Normal file
113
app/Models/BaseModel.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class BaseModel extends Model
|
||||
{
|
||||
|
||||
private static $removeAppends = [];
|
||||
private static $addAppends = [];
|
||||
private static $addWith = [];
|
||||
|
||||
public function removeAppends ( array $appends )
|
||||
{
|
||||
$appends = is_array($appends)?$appends:[];
|
||||
self::$removeAppends = $appends;
|
||||
}
|
||||
|
||||
public function addAppends ( array $appends )
|
||||
{
|
||||
$appends = is_array($appends)?$appends:[];
|
||||
self::$addAppends = $appends;
|
||||
}
|
||||
|
||||
/*public function addWith (array $with )
|
||||
{
|
||||
$with = is_array($with)?$with:[];
|
||||
self::$addWith = $with;
|
||||
}*/
|
||||
|
||||
private function _removeAppends ()
|
||||
{
|
||||
try
|
||||
{
|
||||
$origin = $this->appends;
|
||||
if ( ! is_array ( $this->appends ))
|
||||
{
|
||||
return $origin;
|
||||
}
|
||||
|
||||
if(isset(self::$removeAppends[0]) && self::$removeAppends[0] == "*")
|
||||
{
|
||||
$this->appends = [];
|
||||
return $this->appends;
|
||||
}
|
||||
|
||||
foreach ($this->appends as $key => $perAppend)
|
||||
{
|
||||
if (in_array ( $perAppend, self::$removeAppends ))
|
||||
{
|
||||
unset( $this->appends[ $key ] );
|
||||
}
|
||||
}
|
||||
return $this->appends;
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
$message = $e->getFile()." ".$e->getLine()." ".$e->getMessage();
|
||||
Log::error($message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function _addAppends()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (self::$addAppends as $perAppend)
|
||||
{
|
||||
$methodMakeUp = "get".strtolower($perAppend)."attribute";
|
||||
if(method_exists($this,$methodMakeUp))
|
||||
{
|
||||
$this->append($perAppend);
|
||||
}
|
||||
}
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
$message = $e->getFile()." ".$e->getLine()." ".$e->getMessage();
|
||||
Log::error($message);
|
||||
}
|
||||
}
|
||||
|
||||
/*private function _addWith ()
|
||||
{
|
||||
foreach (self::$addWith as &$perWith)
|
||||
{
|
||||
try {
|
||||
$this->load($perWith);
|
||||
} catch (Exception $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
if (method_exists($this,$perWith))
|
||||
{
|
||||
$this->load($perWith);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
protected function getArrayableAppends()
|
||||
{
|
||||
/*$this->_addWith();*/
|
||||
$this->_removeAppends();
|
||||
$this->_addAppends();
|
||||
return $this->appends;
|
||||
}
|
||||
|
||||
}
|
||||
163
app/Models/Booking.php
Normal file
163
app/Models/Booking.php
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Booking extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function bookingContact()
|
||||
{
|
||||
return $this->hasOne('App\Models\BookingContact', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'name', 'surname', 'phone_code', 'phone_number', 'email', 'note', 'extra_param', 'language_code', 'country_code', 'invoice_request', 'invoice']);
|
||||
}
|
||||
|
||||
public function bookingChannel()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannel', 'id', 'channel_id')
|
||||
->select(['id', 'name', 'official_name', 'channel_category_id', 'description', 'country_code', 'default_currency', 'logo']);
|
||||
}
|
||||
|
||||
public function channelManager()
|
||||
{
|
||||
return $this->hasOne('App\Models\ChannelManager', 'id', 'channel_manager_id')
|
||||
->select(['id', 'name', 'status']);
|
||||
}
|
||||
|
||||
public function bookingPaymentType()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyBookingPaymentType', 'code', 'payment_type_code')
|
||||
->select(['name', 'language_key', 'code']);
|
||||
}
|
||||
|
||||
public function bookingRoom()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingRoom', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'occupancy_code', 'checkin_date', 'checkout_date', 'availability_code', 'room_id', 'room_name',
|
||||
'room_rate_name', 'room_rate_mapping_id', 'cancellation_policy', 'rate_detail', 'extra_param', 'daily_amount', 'amount', 'discount_amount',
|
||||
'total', 'currency_code', 'property_room_bed_id', 'property_room_bed_group_id', 'smoking_fact_id', 'status']);
|
||||
}
|
||||
|
||||
public function bookingRoomSummary()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingRoom', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'occupancy_code', 'checkin_date', 'checkout_date', 'room_id', 'room_name', 'room_rate_name', 'total', 'currency_code', 'status']);
|
||||
}
|
||||
|
||||
public function bookingRoomPax()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingRoomPax', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'booking_room_id', 'type', 'name', 'surname', 'gender', 'citizen', 'birth_date', 'status']);
|
||||
}
|
||||
|
||||
public function bookingAddon()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingAddon', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'property_channel_addon_id', 'count', 'amount', 'total', 'currency_code', 'attribute']);
|
||||
}
|
||||
|
||||
public function bookingPayment()
|
||||
{
|
||||
return $this->hasOne('App\Models\BookingPayment', 'booking_id', 'id')->orderByDesc('id');
|
||||
}
|
||||
|
||||
public function bookingPaymentData()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingPaymentData', 'booking_id', 'id')->orderByDesc('id')
|
||||
->select(['id', 'booking_id', 'type', 'data']);
|
||||
}
|
||||
|
||||
public function bookingPaymentDataCheck()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingPaymentDataCheck', 'booking_id', 'id')->orderBy('id');
|
||||
}
|
||||
|
||||
public function bookingProperty()
|
||||
{
|
||||
return $this->hasOne('App\Models\Property', 'id', 'property_id')
|
||||
->select(['id', 'name', 'country', 'official_name', 'tax_office', 'tax_number', 'commission', 'commission_offline', 'commission_channel', 'commission_wholesaler']);
|
||||
}
|
||||
|
||||
public function propertyBookingEngine()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyBookingEngine', 'property_id', 'property_id')
|
||||
->select(['id', 'property_id', 'channel_id', 'token'])
|
||||
->where('channel_id', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyBookingChannel()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannel', 'id', 'channel_id')
|
||||
->select(["id", "parent_id", "name", "official_name", "token", "description", "channel_category_id", "country_code", "currency_code", "default_currency", "logo", "address", "zip_code", "email", "phone", "phone2", "fax", "score"]);
|
||||
}
|
||||
|
||||
public function bookingPropertyWeb()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyWeb', 'property_id', 'property_id');
|
||||
}
|
||||
|
||||
public function bookingPaymentTransaction()
|
||||
{
|
||||
return $this->hasMany('App\Models\PaymentTransaction', 'order_id', 'booking_code')
|
||||
->orderByDesc('id');
|
||||
}
|
||||
|
||||
public function bookingStatus()
|
||||
{
|
||||
return $this->hasOne('App\Models\BookingStatus', 'id', 'status')
|
||||
->select(['name', 'language_key', 'id'])->where('status', 1);
|
||||
}
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->hasOne("App\Models\Property", 'id', 'property_id')->select(['id', 'name']);
|
||||
}
|
||||
|
||||
public function bookingActiveMessageCount()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingTicket', 'booking_id', 'id')
|
||||
->select(['id', 'booking_id', 'code', 'parent_id'])
|
||||
->where('status', 1)->where('user_id', null)->where('is_viewed', null)
|
||||
->where('is_log', null);
|
||||
}
|
||||
|
||||
public function propertyChannelMapping()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannelMapping', 'property_id', 'property_id')
|
||||
->where('channel_id', '=', 1)
|
||||
->select("id", "property_id", "channel_id", "currency_code", "channel_tax_id", "status");
|
||||
}
|
||||
|
||||
|
||||
public function propertyBookingEngineSearch()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyBookingEngineSearch', 'search_key', 'search_key')
|
||||
->where('channel_id', '=', 1)->select();
|
||||
}
|
||||
|
||||
public function channelManagerBooking()
|
||||
{
|
||||
return $this->hasMany('App\Models\ChannelManagerBooking', 'booking_id', 'id')
|
||||
->select(['id', 'property_id', 'booking_id','channel_manager_id', 'type', 'is_pushed', 'status']);
|
||||
}
|
||||
}
|
||||
38
app/Models/BookingAddon.php
Normal file
38
app/Models/BookingAddon.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingAddon extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_addon';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function propertyChannelAddon(){
|
||||
return $this->hasOne('App\Models\PropertyChannelAddon','id', 'property_channel_addon_id')
|
||||
->select(['id','title', 'description','property_addon_id','min_stay','type','amount']);
|
||||
}
|
||||
|
||||
public function propertyAddon(){
|
||||
return $this->hasOne('App\Models\PropertyAddon','id', 'property_addon_id')
|
||||
->select(['id','fact_id', 'title', 'attribute']);
|
||||
}
|
||||
|
||||
}
|
||||
46
app/Models/BookingContact.php
Normal file
46
app/Models/BookingContact.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingContact extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_contact';
|
||||
protected $appends = ['nameSurname','phoneFormatted','invoiceArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function getNameSurnameAttribute()
|
||||
{
|
||||
return $this->name . ' ' . $this->surname;
|
||||
}
|
||||
|
||||
public function getPhoneFormattedAttribute()
|
||||
{
|
||||
return $this->phone_code . '' . $this->phone_number;
|
||||
}
|
||||
|
||||
public function getInvoiceArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->invoice)) {
|
||||
return json_decode($this->invoice, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
34
app/Models/BookingPayment.php
Normal file
34
app/Models/BookingPayment.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingPayment extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_payment';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function paymentTypeCode(){
|
||||
return $this->hasOne('App\Models\PropertyBookingPaymentType', 'code', 'payment_type_code')->select(['code','name','language_key']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
35
app/Models/BookingPaymentData.php
Normal file
35
app/Models/BookingPaymentData.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingPaymentData extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_payment_data';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function bookingDetail()
|
||||
{
|
||||
return $this->hasOne('App\Models\Booking', 'id', 'booking_id')
|
||||
->select(['id', 'channel_id', 'channel_manager_id', 'booking_code', 'checkin_date', 'checkout_date', 'payment_type_code', 'total', 'currency_code', 'created_at', 'updated_at', 'status']);
|
||||
}
|
||||
|
||||
}
|
||||
30
app/Models/BookingPaymentDataCheck.php
Normal file
30
app/Models/BookingPaymentDataCheck.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingPaymentDataCheck extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_payment_data_check';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
42
app/Models/BookingRoom.php
Normal file
42
app/Models/BookingRoom.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingRoom extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_room';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
public function roomPax()
|
||||
{
|
||||
return $this->hasMany('App\Models\BookingRoomPax', 'booking_room_id', 'id');
|
||||
}
|
||||
|
||||
public function roomRateMapping()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyRoomRateMapping','id', 'room_rate_mapping_id')->select();
|
||||
}
|
||||
|
||||
public function propertyRoomBed()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyRoomBed', 'id', 'property_room_bed_id')->select();
|
||||
}
|
||||
|
||||
public function smokingFact()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyFact', 'id', 'smoking_fact_id')->select();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
34
app/Models/BookingRoomPax.php
Normal file
34
app/Models/BookingRoomPax.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingRoomPax extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_room_pax';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = ['updated_at'];
|
||||
|
||||
|
||||
public function paxCountry(){
|
||||
return $this->hasOne('App\Models\Country', 'country_code', 'citizen')
|
||||
->select(['id', 'name', 'language_key', 'country_code', 'phone_code']) ;
|
||||
}
|
||||
|
||||
}
|
||||
22
app/Models/BookingStatus.php
Normal file
22
app/Models/BookingStatus.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class BookingStatus extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'booking_status';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
40
app/Models/BookingTicket.php
Normal file
40
app/Models/BookingTicket.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class BookingTicket extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'booking_ticket';
|
||||
protected $appends = ['createdTime'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function getCreatedTimeAttribute()
|
||||
{
|
||||
return Carbon::parse($this->created_at)->toDateTimeString();
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne('App\Models\User', 'id', 'user_id')->select(['id','name','surname']);
|
||||
}
|
||||
|
||||
}
|
||||
20
app/Models/ChannelManager.php
Normal file
20
app/Models/ChannelManager.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManager extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'channel_manager';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
}
|
||||
41
app/Models/ChannelManagerBooking.php
Normal file
41
app/Models/ChannelManagerBooking.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManagerBooking extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'channel_manager_booking';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function bookingDetail()
|
||||
{
|
||||
return $this->hasOne('App\Models\Booking', 'id', 'booking_id')
|
||||
->select([
|
||||
'id', 'channel_id', 'channel_manager_id', 'property_id', 'booking_code','channel_booking_code', 'checkin_date', 'checkout_date', 'rooms',
|
||||
'payment_type_code', 'room_amount', 'addon_amount', 'discount_amount', 'total', 'currency_code', 'extra_param', 'created_at', 'updated_at', 'status'
|
||||
]);
|
||||
}
|
||||
|
||||
public function channelManager()
|
||||
{
|
||||
return $this->hasOne('App\Models\ChannelManager', 'id', 'channel_manager_id')->select(['id', 'name', 'status']);
|
||||
}
|
||||
}
|
||||
20
app/Models/ChannelManagerLog.php
Normal file
20
app/Models/ChannelManagerLog.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManagerLog extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'channel_manager_log';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
}
|
||||
25
app/Models/ChannelManagerMapping.php
Normal file
25
app/Models/ChannelManagerMapping.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManagerMapping extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'channel_manager_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function propertyChannelManager()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyChannel", 'id', 'property_channel_id')->select(['id', 'name']);
|
||||
}
|
||||
|
||||
}
|
||||
29
app/Models/ChannelManagerPropertyMapping.php
Normal file
29
app/Models/ChannelManagerPropertyMapping.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManagerPropertyMapping extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'channel_manager_property_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
public function channelManagerRoomRate()
|
||||
{
|
||||
return $this->hasMany("App\Models\ChannelManagerPropertyRateMapping", 'channel_manager_property_mapping_id', 'id')
|
||||
->select(['id','channel_manager_property_mapping_id','property_room_rate_mapping_id','channel_manager_room_id', 'channel_manager_room_rate_id','included_occupancy']);
|
||||
}
|
||||
|
||||
public function property(){
|
||||
return $this->hasOne('App\Models\Property','id', 'property_id')
|
||||
->select(['id', 'name','country','destination_id','property_type_id','status']);
|
||||
}
|
||||
}
|
||||
24
app/Models/ChannelManagerPropertyRateMapping.php
Normal file
24
app/Models/ChannelManagerPropertyRateMapping.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ChannelManagerPropertyRateMapping extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'channel_manager_property_rate_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
public function propertyRoomRateMapping()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyRoomRateMapping", 'id', 'property_room_rate_mapping_id')->select(['id','room_id','room_rate_id','status']);
|
||||
}
|
||||
|
||||
}
|
||||
18
app/Models/Country.php
Normal file
18
app/Models/Country.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class Country extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'country';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
|
||||
}
|
||||
21
app/Models/Currency.php
Normal file
21
app/Models/Currency.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class Currency extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'currency';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
|
||||
protected $guarded = [ ];
|
||||
|
||||
protected $hidden = [];
|
||||
}
|
||||
21
app/Models/CurrencyRates.php
Normal file
21
app/Models/CurrencyRates.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class CurrencyRates extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'currency_rates';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
}
|
||||
18
app/Models/Destination.php
Normal file
18
app/Models/Destination.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class Destination extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'destination';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
|
||||
}
|
||||
25
app/Models/FailedJobs.php
Normal file
25
app/Models/FailedJobs.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class FailedJobs extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'failed_jobs';
|
||||
|
||||
|
||||
protected $guarded = [ ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [ ];
|
||||
|
||||
}
|
||||
33
app/Models/GeneralTimezone.php
Normal file
33
app/Models/GeneralTimezone.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class GeneralTimezone extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'general_timezone';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/IpNation.php
Normal file
30
app/Models/IpNation.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class IpNation extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'ip_nation';
|
||||
|
||||
|
||||
protected $guarded = [ ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [ ];
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->hasOne('App\Models\IpNationCountries','code', 'country');
|
||||
}
|
||||
|
||||
}
|
||||
25
app/Models/IpNationCountries.php
Normal file
25
app/Models/IpNationCountries.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class IpNationCountries extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'ip_nation_countries';
|
||||
|
||||
|
||||
protected $guarded = [ ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [ ];
|
||||
|
||||
}
|
||||
27
app/Models/Jobs.php
Normal file
27
app/Models/Jobs.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class Jobs extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'jobs';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
|
||||
|
||||
protected $guarded = [ ];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [ ];
|
||||
|
||||
}
|
||||
30
app/Models/Language.php
Normal file
30
app/Models/Language.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Language extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'language';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/LanguageBase.php
Normal file
30
app/Models/LanguageBase.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class LanguageBase extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'language_base';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/LanguageTranslate.php
Normal file
30
app/Models/LanguageTranslate.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class LanguageTranslate extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'language_translate';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
130
app/Models/Offer.php
Normal file
130
app/Models/Offer.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Offer extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function offerAccommodationMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferAccommodationMapping', 'offer_id', 'id')->select("id", "offer_id", "property_accommodation_id");
|
||||
}
|
||||
|
||||
public function offerCancellationPolicy()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferCancellationPolicy', 'offer_id', 'id')->select("id", "offer_id", "days_before", "type", "value");
|
||||
}
|
||||
|
||||
public function offerContactMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferContactMapping', 'offer_id', 'id')
|
||||
->select("id", "offer_id", "property_executive_id", "status")
|
||||
->where("status", "=", 1);
|
||||
}
|
||||
|
||||
public function offerFactMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferFactMapping', 'offer_id', 'id')->select("id",
|
||||
"offer_id",
|
||||
"category_id",
|
||||
"property_fact_parent_id",
|
||||
"property_fact_id"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerImportantNotes()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferImportantNotes', 'offer_id', 'id')->select("id",
|
||||
"offer_id",
|
||||
"note"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerPhotoMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferPhotoMapping', 'offer_id', 'id')->select("id",
|
||||
"offer_id",
|
||||
"property_photo_id",
|
||||
"is_cover"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerPrice()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferPrice', 'offer_id', 'id')->select("id",
|
||||
"offer_id",
|
||||
"date",
|
||||
"property_room_id",
|
||||
"property_accommodation_id",
|
||||
"number_of_rooms",
|
||||
"currency",
|
||||
"amount",
|
||||
"total_amount"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerRoomMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\OfferRoomMapping', 'offer_id', 'id')->select("id",
|
||||
"offer_id",
|
||||
"property_room_id"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerLanguage()
|
||||
{
|
||||
return $this->hasOne('App\Models\Language', 'code', 'language')->select(
|
||||
"code",
|
||||
"name",
|
||||
"language_key"
|
||||
);
|
||||
}
|
||||
|
||||
public function offerAcceptStatus()
|
||||
{
|
||||
return $this->hasOne('App\Models\OfferAcceptStatus', 'id', 'accept_status')->select("id", "name", "language_key");
|
||||
}
|
||||
|
||||
public function createUser()
|
||||
{
|
||||
return $this->hasOne('App\Models\User', 'id', 'created_by')->select("id", "name", "surname", "email");
|
||||
}
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->hasOne("App\Models\Property", 'id', 'property_id')->select(['id', 'name']);
|
||||
}
|
||||
|
||||
public function paymentTransaction()
|
||||
{
|
||||
return $this->hasMany('App\Models\PaymentTransaction', 'order_id', 'payment_transaction_order_id')
|
||||
->select("id", "code", "order_id", "base_amount", "base_currency", "status");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/OfferAcceptStatus.php
Normal file
30
app/Models/OfferAcceptStatus.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferAcceptStatus extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_accept_status';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
49
app/Models/OfferAccommodationMapping.php
Normal file
49
app/Models/OfferAccommodationMapping.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferAccommodationMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_accommodation_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function propertyAccommodation()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyFact','id', 'property_accommodation_id')
|
||||
->select(
|
||||
"id",
|
||||
"name",
|
||||
"parent_id",
|
||||
"type",
|
||||
"order_number",
|
||||
"icon",
|
||||
"status",
|
||||
"language_key"
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
33
app/Models/OfferCancellationPolicy.php
Normal file
33
app/Models/OfferCancellationPolicy.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferCancellationPolicy extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_cancellation_policy';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
32
app/Models/OfferConfirmType.php
Normal file
32
app/Models/OfferConfirmType.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferConfirmType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_confirm_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
}
|
||||
39
app/Models/OfferContactMapping.php
Normal file
39
app/Models/OfferContactMapping.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferContactMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_contact_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public function propertyExecutive()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyExecutive','id', 'property_executive_id');
|
||||
}
|
||||
|
||||
}
|
||||
36
app/Models/OfferFactMapping.php
Normal file
36
app/Models/OfferFactMapping.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferFactMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_fact_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function propertyFact()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyFact','id', 'property_fact_id');
|
||||
}
|
||||
}
|
||||
33
app/Models/OfferImportantNotes.php
Normal file
33
app/Models/OfferImportantNotes.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferImportantNotes extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_important_notes';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
33
app/Models/OfferPaymentType.php
Normal file
33
app/Models/OfferPaymentType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferPaymentType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_payment_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
38
app/Models/OfferPhotoMapping.php
Normal file
38
app/Models/OfferPhotoMapping.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferPhotoMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_photo_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function propertyPhoto()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPhoto','id', 'property_photo_id');
|
||||
}
|
||||
|
||||
}
|
||||
33
app/Models/OfferPrice.php
Normal file
33
app/Models/OfferPrice.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferPrice extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_price';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
57
app/Models/OfferRoomMapping.php
Normal file
57
app/Models/OfferRoomMapping.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class OfferRoomMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'offer_room_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function propertyRoom()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyRoom','id', 'property_room_id')
|
||||
->select(
|
||||
"id",
|
||||
"property_id",
|
||||
"name",
|
||||
"room_type_id",
|
||||
"max_occupancy",
|
||||
"max_adult",
|
||||
"max_child",
|
||||
"exclude_occupancy",
|
||||
"room_size",
|
||||
'room_size_type',
|
||||
'room_type_count',
|
||||
'room_count',
|
||||
'bathroom_count',
|
||||
'toilet_count',
|
||||
'lounge_count',
|
||||
'max_child_number'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
29
app/Models/PaymentBinNumber.php
Normal file
29
app/Models/PaymentBinNumber.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PaymentBinNumber extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'payment_bin_number';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
}
|
||||
102
app/Models/PaymentTransaction.php
Normal file
102
app/Models/PaymentTransaction.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class PaymentTransaction extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'payment_transaction';
|
||||
protected $appends = ['paramsArray', 'extraParamsArray', 'responseArray', 'manuelPaymentLink'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function getParamsArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->params)) {
|
||||
return json_decode($this->params, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getExtraParamsArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->extra_params)) {
|
||||
return json_decode($this->extra_params, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getResponseArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->response)) {
|
||||
return json_decode($this->response, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getManuelPaymentLinkAttribute()
|
||||
{
|
||||
if (!is_null($this->transaction_type == 'LNK')) {
|
||||
return Config::get('app.paymentFormLink') . $this['order_id'];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function paymentTypeMapping()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPaymentMapping', 'id', 'payment_type_mapping_id');
|
||||
}
|
||||
|
||||
public function bookingDetail()
|
||||
{
|
||||
return $this->hasMany('App\Models\Booking', 'booking_code', 'order_id')
|
||||
->select(['id', 'channel_id', 'booking_code', 'checkin_date', 'checkout_date', 'payment_type_code', 'total', 'currency_code', 'created_at', 'updated_at', 'status']);
|
||||
}
|
||||
|
||||
public function relatedTransactions()
|
||||
{
|
||||
return $this->hasMany('App\Models\PaymentTransaction', 'order_id', 'order_id')->where('code', '<>', null)->orderByDesc('id');
|
||||
}
|
||||
|
||||
public function paymentTransactionStatus()
|
||||
{
|
||||
return $this->hasOne('App\Models\PaymentTransactionStatus', 'id', 'status');
|
||||
}
|
||||
|
||||
public function parentTransaction()
|
||||
{
|
||||
return $this->hasOne('App\Models\PaymentTransaction', 'order_id', 'order_id')->where('code', '=', null);
|
||||
}
|
||||
|
||||
public function paymentUser()
|
||||
{
|
||||
return $this->hasOne('App\Models\User', 'id', 'created_by')->select(['id', 'name', 'surname', 'email', 'user_type', 'language', 'phone']);
|
||||
}
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->belongsTo("App\Models\Property", "property_id");
|
||||
}
|
||||
}
|
||||
30
app/Models/PaymentTransactionStatus.php
Normal file
30
app/Models/PaymentTransactionStatus.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PaymentTransactionStatus extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'payment_transaction_status';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
38
app/Models/PaymentType.php
Normal file
38
app/Models/PaymentType.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PaymentType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'payment_type';
|
||||
protected $appends = ['paramsArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function getParamsArrayAttribute()
|
||||
{
|
||||
if(!is_null($this->params)) {
|
||||
return json_decode($this->params,1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
36
app/Models/Permission.php
Normal file
36
app/Models/Permission.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Permission extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'permission';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function permissionGroupMapping ()
|
||||
{
|
||||
return $this->hasOne("\App\Models\PermissionGroupMapping","permission_id");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
40
app/Models/PermissionGroup.php
Normal file
40
app/Models/PermissionGroup.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PermissionGroup extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'permission_group';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function getParameterRulesArrayAttribute()
|
||||
{
|
||||
try
|
||||
{
|
||||
return json_decode($this->parameter_rules, true);
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
38
app/Models/PermissionGroupMapping.php
Normal file
38
app/Models/PermissionGroupMapping.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PermissionGroupMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'permission_group_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function permissionGroup ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\PermissionGroup","permission_group_id");
|
||||
}
|
||||
|
||||
public function permission ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\Permission","permission_id");
|
||||
}
|
||||
|
||||
}
|
||||
88
app/Models/PermissionGroupUserMapping.php
Normal file
88
app/Models/PermissionGroupUserMapping.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PermissionGroupUserMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'permission_group_user_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function createUser ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\User","created_by");
|
||||
}
|
||||
|
||||
public function property ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\Property","property_id");
|
||||
}
|
||||
|
||||
public function user ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\User","user_id");
|
||||
}
|
||||
|
||||
public function permissionGroup ()
|
||||
{
|
||||
return $this->belongsTo("App\Models\PermissionGroup","permission_group_id");
|
||||
}
|
||||
|
||||
public function permissionGroupMapping ()
|
||||
{
|
||||
return $this->hasMany("\App\Models\PermissionGroupMapping","permission_group_id","permission_group_id");
|
||||
}
|
||||
|
||||
public function getRelatedParametersArrayAttribute ()
|
||||
{
|
||||
try
|
||||
{
|
||||
return json_decode ( $this->related_parameters,true );
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public function getRelatedParametersEmployeeDepartmentsAttribute ()
|
||||
{
|
||||
try
|
||||
{
|
||||
$departments = [];
|
||||
$relatedParameters = $this->getRelatedParametersArrayAttribute ();
|
||||
|
||||
if ( !$relatedParameters)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($relatedParameters["employee_departments"] as $perParameter)
|
||||
{
|
||||
$departments[] = $perParameter["department_id"];
|
||||
}
|
||||
|
||||
return $departments;
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
79
app/Models/PermissionMenuModel.php
Normal file
79
app/Models/PermissionMenuModel.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Exception;
|
||||
|
||||
class PermissionMenuModel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'permission';
|
||||
protected $appends = ["url","component"];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [ ];
|
||||
|
||||
public function children ()
|
||||
{
|
||||
return $this->hasMany("\App\Models\PermissionMenuModel","parent_id","id")
|
||||
->with("children");
|
||||
}
|
||||
|
||||
|
||||
protected function getHasLinkAttribute ()
|
||||
{
|
||||
return $this->url?true:false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getMenuDetailArrayAttribute ()
|
||||
{
|
||||
try
|
||||
{
|
||||
return json_decode ( $this->menu_detail, true );
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
public function getUrlAttribute ( )
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->menuDetailArray[ "url" ];
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getComponentAttribute ( )
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->menuDetailArray[ "component" ];
|
||||
} catch ( Exception $e )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
41
app/Models/PhotoGoogleLabel.php
Normal file
41
app/Models/PhotoGoogleLabel.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PhotoGoogleLabel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'photo_google_label';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public function photoCategoryLabelMapping(){
|
||||
|
||||
|
||||
return $this->hasOne('App\Models\PropertyPhotoCategoryLabelMapping','photo_google_label_id', 'id');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
42
app/Models/PlaceCategoryField.php
Normal file
42
app/Models/PlaceCategoryField.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PlaceCategoryField extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'place_category_field';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function placeFieldOptionMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PlaceCategoryFieldOptionFieldMapping','field_id', 'id')
|
||||
->select("id", "field_id", "field_option_id", "order_number", "status")
|
||||
->where('status','=',1)
|
||||
->orderBy('order_number');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
48
app/Models/PlaceCategoryFieldMapping.php
Normal file
48
app/Models/PlaceCategoryFieldMapping.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PlaceCategoryFieldMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'place_category_field_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function propertyPlaceCategory()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPlaceCategory','id', 'property_place_category_id')
|
||||
->select("id", "name", "language_key", "parent_id", "level","order_number","icon") ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function placeCategoryField()
|
||||
{
|
||||
return $this->hasOne('App\Models\PlaceCategoryField','id', 'property_place_category_field_id')
|
||||
->select("id", "name", "language_key", "label", "element","type","field_attribute", "status") ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
33
app/Models/PlaceCategoryFieldOption.php
Normal file
33
app/Models/PlaceCategoryFieldOption.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PlaceCategoryFieldOption extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'place_category_field_option';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
41
app/Models/PlaceCategoryFieldOptionFieldMapping.php
Normal file
41
app/Models/PlaceCategoryFieldOptionFieldMapping.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PlaceCategoryFieldOptionFieldMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'place_category_field_option_field_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function placeCategoryFieldOption()
|
||||
{
|
||||
return $this->hasOne('App\Models\PlaceCategoryFieldOption','id', 'field_option_id')
|
||||
->select("id", "name", "language_key", "status")
|
||||
->where('status','=',1) ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
app/Models/Product.php
Normal file
30
app/Models/Product.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Product extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'product';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
28
app/Models/ProductParameter.php
Normal file
28
app/Models/ProductParameter.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ProductParameter extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'product_parameter';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
}
|
||||
33
app/Models/ProductParameterMapping.php
Normal file
33
app/Models/ProductParameterMapping.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class ProductParameterMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'product_parameter_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function parameterDetail()
|
||||
{
|
||||
return $this->hasOne(ProductParameter::class, 'id', 'product_parameter_id');
|
||||
}
|
||||
|
||||
}
|
||||
37
app/Models/PromotionType.php
Normal file
37
app/Models/PromotionType.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PromotionType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'promotion_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function parentPromotionType(){
|
||||
return $this->hasOne('App\Models\PromotionType', 'id', 'parent_id')
|
||||
->select(['id', 'name', 'language_key', 'parent_id', 'type_code', 'order_number', 'status']);
|
||||
}
|
||||
|
||||
}
|
||||
202
app/Models/Property.php
Normal file
202
app/Models/Property.php
Normal file
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class Property extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function propertyPhotos()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyPhoto', 'property_id', 'id')
|
||||
->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyExecutive()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyExecutive', 'property_id', 'id');
|
||||
}
|
||||
|
||||
public function propertyUser()
|
||||
{
|
||||
return $this->hasMany('App\Models\UserPropertyMapping', 'property_id', 'id');
|
||||
}
|
||||
|
||||
public function propertyContractUser()
|
||||
{
|
||||
return $this->hasOne('App\Models\User', 'id', 'contract_user_id');
|
||||
}
|
||||
|
||||
public function propertyType()
|
||||
{
|
||||
return $this->belongsTo('App\Models\PropertyType', 'property_type_id', 'id')
|
||||
->select('id', 'name', 'language_key');
|
||||
}
|
||||
|
||||
|
||||
public function defaultPropertyPhoto()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPhoto', 'property_id', 'id')
|
||||
->where('is_default', '=', 1);
|
||||
}
|
||||
|
||||
|
||||
public function propertyChain()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChain', 'id', 'chain_id')
|
||||
->select('id', 'name');
|
||||
}
|
||||
|
||||
public function propertyDestination()
|
||||
{
|
||||
return $this->hasOne('App\Models\Destination', 'id', 'destination_id')->select('id', 'name');
|
||||
}
|
||||
|
||||
public function propertyRooms()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyRoom', 'property_id', 'id')
|
||||
->select(
|
||||
'id', 'property_id', 'name', 'room_type_id', 'max_occupancy', 'max_adult', 'max_child', 'max_child_number',
|
||||
'exclude_occupancy', 'room_type_count', 'room_size', 'room_size_type', 'room_count', 'bathroom_count', 'lounge_count'
|
||||
)
|
||||
->where('status', '=', 1);
|
||||
|
||||
}
|
||||
|
||||
public function propertyBrand()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyBrand', 'property_id', 'id')->select(['id', 'property_id', 'title', 'color_codes', 'logo_name', 'logo_file_ext']);
|
||||
}
|
||||
|
||||
|
||||
public function propertyContact()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyContact', 'property_id', 'id')
|
||||
->select(['id', 'property_id', 'phone_code', 'phone', 'mobile_code', 'mobile', 'mobile2_code', 'mobile2', 'fax_code', 'fax', 'email', 'web', 'meta', 'social_media_addresses', 'zip_code', 'address', 'latitude', 'longitude']);
|
||||
}
|
||||
|
||||
public function propertyWeb()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyWeb', 'property_id', 'id')
|
||||
->select(['id', 'property_id', 'domain', 'default_language', 'template_id', 'token', 'status', 'is_dns_checked', 'is_ssl_active', 'is_published'])
|
||||
->orderBy('id', 'DESC');
|
||||
}
|
||||
|
||||
public function propertyWebRooms()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyWebRoomMapping', 'property_id', 'id')
|
||||
->select('id', 'property_id', 'property_room_id')
|
||||
->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyBookingEngineGroupMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyGroupMapping', 'property_id', 'id')
|
||||
->select(['id', 'property_id', 'property_group_id', 'order_number', 'status'])
|
||||
->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyBookingEngineToken()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyBookingEngine', 'property_id', 'id')
|
||||
->select(['id', 'property_id', 'channel_id', 'token', 'status'])
|
||||
->where('channel_id', '=', 1)
|
||||
->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyBookingEngines()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyBookingEngine', 'property_id', 'id')
|
||||
->select(['id', 'property_id', 'channel_id', 'token', 'status'])
|
||||
->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyLanguageSpoken()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyLanguageSpoken', 'property_id', 'id')
|
||||
->select('id', 'property_id', 'language_code', 'status')
|
||||
->where('status', '=', 1);
|
||||
|
||||
}
|
||||
|
||||
public function propertyAwardsCertificates()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyAwardsCertificate', 'property_id', 'id')
|
||||
->select('id', 'property_id', 'category_id', 'name', 'date', 'url', 'file_path', 'file_type', 'language_code', 'status');
|
||||
|
||||
}
|
||||
|
||||
public function propertyAdditionalInfos()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyAdditionalInfo', 'property_id', 'id')->select('id', 'property_id', 'additional_info_key_id', 'value');
|
||||
|
||||
}
|
||||
|
||||
public function propertyProductMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyProductMapping', 'property_id', 'id')->select('id', 'property_id', 'product_id', 'expiration_date', 'status');
|
||||
}
|
||||
|
||||
public function userPropertyMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\UserPropertyMapping', 'property_id', 'id')->select('id', 'property_id', 'user_id', 'status')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyPlace()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyPlace', 'property_id', 'id')->select('id', 'property_id', 'name', 'place_category_id', 'description', 'status')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->hasOne('App\Models\Country', 'country_code', 'country')->select('name', 'language_key', 'country_code');
|
||||
}
|
||||
|
||||
public function propertyWebComponent()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyWebComponentMapping', 'property_id', 'id')->select('id', 'property_id', 'channel_id', 'component_id', 'status')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyPromotionMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyPromotionMapping', 'property_id', 'id')->select('id', 'property_id', 'room_rate_channel_mapping_id', 'property_promotion_id', 'status')->where('status', '=', 1);
|
||||
}
|
||||
|
||||
public function propertyFactMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyFactMapping', 'property_id', 'id')->select('id', 'property_id', 'fact_id');
|
||||
}
|
||||
|
||||
public function propertyPaymentMapping()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyPaymentMapping', 'property_id', 'id')->select('id', 'property_id', 'payment_type_id', 'status');
|
||||
}
|
||||
|
||||
public function propertyStatus()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyStatus', 'id', 'status')->select('id', 'name', 'status');
|
||||
}
|
||||
|
||||
}
|
||||
26
app/Models/PropertyAdditionalInfo.php
Normal file
26
app/Models/PropertyAdditionalInfo.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class PropertyAdditionalInfo extends BaseModel
|
||||
{
|
||||
protected $table = 'property_additional_info';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
protected $appends = [];
|
||||
protected $guarded = [];
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function propertyAdditionalInfoKey()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyAdditionalInfoKey", 'id', 'additional_info_key_id')->select(['id' , 'additional_info_key', 'language_key' ]);
|
||||
}
|
||||
|
||||
}
|
||||
24
app/Models/PropertyAdditionalInfoKey.php
Normal file
24
app/Models/PropertyAdditionalInfoKey.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
|
||||
|
||||
class PropertyAdditionalInfoKey extends BaseModel
|
||||
{
|
||||
protected $table = 'property_additional_info_key';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
protected $appends = [];
|
||||
protected $guarded = [];
|
||||
protected $hidden = [];
|
||||
|
||||
public function propertyAdditionalLocale()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyAdditionalInfoKeyLocale','additional_info_key_id','id');
|
||||
}
|
||||
}
|
||||
36
app/Models/PropertyAddon.php
Normal file
36
app/Models/PropertyAddon.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyAddon extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_addon';
|
||||
protected $appends = ['attributeArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
protected $hidden = [];
|
||||
|
||||
function getAttributeArrayAttribute()
|
||||
{
|
||||
$attribute = [];
|
||||
if (!empty($this->attribute)) {
|
||||
$attribute = json_decode($this->attribute, 1);
|
||||
}
|
||||
return $attribute;
|
||||
}
|
||||
|
||||
public function fact()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyFact", 'id', 'fact_id')->select('id', 'parent_id', 'name', 'icon', 'language_key');
|
||||
}
|
||||
|
||||
}
|
||||
30
app/Models/PropertyAvailabilityType.php
Normal file
30
app/Models/PropertyAvailabilityType.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyAvailabilityType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_availability_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
39
app/Models/PropertyAwardsCertificate.php
Normal file
39
app/Models/PropertyAwardsCertificate.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyAwardsCertificate extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_awards_certificate';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function awardsCertificateCategory()
|
||||
{
|
||||
return $this->hasOne('App\Models\AwardsCertificateCategory','id', 'category_id')
|
||||
->select("id", "name", "language_key", "country_code", "logo", "type", "status");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
76
app/Models/PropertyBookingEngine.php
Normal file
76
app/Models/PropertyBookingEngine.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyBookingEngine extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_booking_engine';
|
||||
protected $appends = ['parametersArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function getParametersArrayAttribute()
|
||||
{
|
||||
$parameters = null;
|
||||
if (!is_null($this->parameters)) {
|
||||
$parametersArray = json_decode($this->parameters, 1);
|
||||
if (is_array($parametersArray)) {
|
||||
$parameters = $parametersArray;
|
||||
}
|
||||
}
|
||||
|
||||
return $parameters;
|
||||
}
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->hasOne("App\Models\Property", 'id', 'property_id')
|
||||
->select(['id', 'name', 'country', 'destination_id','property_type_id','mapping']);
|
||||
}
|
||||
|
||||
public function channel()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyChannel", 'id', 'channel_id')->select(['id', 'name', 'token', 'channel_category_id', 'contact']);
|
||||
}
|
||||
|
||||
public function propertyWeb()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyWeb', 'property_id', 'property_id')
|
||||
->where('status', '=', 1)
|
||||
->select("id", "property_id", "domain", "default_language", "template_id", "token");
|
||||
}
|
||||
|
||||
public function propertyChannelMapping()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannelMapping', 'property_id', 'property_id')
|
||||
->where('channel_id', '=', 1)
|
||||
->select("id", "property_id", "channel_id", "currency_code", "channel_tax_id", "status");
|
||||
}
|
||||
|
||||
public function propertyWebComponent()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyWebComponentMapping','property_id', 'property_id')
|
||||
->select('id','property_id','channel_id','component_id','parameter','language','status')->where('status',1);
|
||||
}
|
||||
|
||||
}
|
||||
30
app/Models/PropertyBookingEngineSearch.php
Normal file
30
app/Models/PropertyBookingEngineSearch.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyBookingEngineSearch extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_booking_engine_search';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/PropertyBookingPaymentType.php
Normal file
30
app/Models/PropertyBookingPaymentType.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyBookingPaymentType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_booking_payment_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
30
app/Models/PropertyBookingType.php
Normal file
30
app/Models/PropertyBookingType.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyBookingType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_booking_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
44
app/Models/PropertyBrand.php
Normal file
44
app/Models/PropertyBrand.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class PropertyBrand extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_brand';
|
||||
protected $appends = ['logoUrl'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function getLogoUrlAttribute()
|
||||
{
|
||||
$logoUrl = Config::get('app.client_server').'/assets/img/logo/logo.png';
|
||||
if (!is_null($this->logo_name)) {
|
||||
$logoUrl = Config::get('app.imageUrl') . '/property-photos/' . $this->property_id . '/logo/' . $this->logo_name . '_250x250.' . $this->logo_file_ext;
|
||||
}
|
||||
|
||||
return $logoUrl;
|
||||
}
|
||||
|
||||
}
|
||||
21
app/Models/PropertyCancellationPolicy.php
Normal file
21
app/Models/PropertyCancellationPolicy.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyCancellationPolicy extends BaseModel
|
||||
{
|
||||
protected $table = 'property_cancellation_policy';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
|
||||
}
|
||||
34
app/Models/PropertyChain.php
Normal file
34
app/Models/PropertyChain.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChain extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_chain';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
59
app/Models/PropertyChannel.php
Normal file
59
app/Models/PropertyChannel.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class PropertyChannel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel';
|
||||
protected $appends = ['logoUrl', 'countryCodeGroupArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function getLogoUrlAttribute()
|
||||
{
|
||||
//return Config::get('app.client_server') . '/assets/img/brands/' . $this->id . '.png';
|
||||
return Config::get('app.client_server') . '/assets/img/brands/' . $this->logo;
|
||||
}
|
||||
|
||||
public function getCountryCodeGroupArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->country_code_group)) {
|
||||
return json_decode($this->country_code_group, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function propertyChannelCategory()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannelCategory', 'id', 'channel_category_id')->select(['id', 'name', 'language_key']);
|
||||
}
|
||||
|
||||
public function parentChannel()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyChannel', 'id', 'parent_id')->select(['id', 'parent_id', 'name', 'official_name', 'description', 'channel_category_id', 'country_code', 'currency_code', 'default_currency', 'logo', 'address', 'zip_code', 'email', 'phone', 'phone2', 'fax', 'score', 'status']);
|
||||
}
|
||||
}
|
||||
37
app/Models/PropertyChannelAddon.php
Normal file
37
app/Models/PropertyChannelAddon.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelAddon extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_addon';
|
||||
protected $appends = ['descriptionArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
protected $hidden = [];
|
||||
|
||||
function getDescriptionArrayAttribute()
|
||||
{
|
||||
$description = [];
|
||||
if (!empty($this->description)) {
|
||||
$description = json_decode($this->description, 1);
|
||||
}
|
||||
return $description;
|
||||
}
|
||||
|
||||
public function propertyAddon()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyAddon", 'id', 'property_addon_id')->select('id','fact_id','title','attribute');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
45
app/Models/PropertyChannelBookingPaymentSetup.php
Normal file
45
app/Models/PropertyChannelBookingPaymentSetup.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelBookingPaymentSetup extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_booking_payment_setup';
|
||||
protected $appends = ['cancellationPolicyArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function getCancellationPolicyArrayAttribute()
|
||||
{
|
||||
if (!is_null($this->cancellation_policy)) {
|
||||
return json_decode($this->cancellation_policy, 1);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function paymentType()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyBookingPaymentType", 'id', 'payment_type_id')->select(['id', 'name', 'language_key', 'code', 'status']);
|
||||
}
|
||||
}
|
||||
33
app/Models/PropertyChannelCategory.php
Normal file
33
app/Models/PropertyChannelCategory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelCategory extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_category';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
31
app/Models/PropertyChannelContact.php
Normal file
31
app/Models/PropertyChannelContact.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: burhan
|
||||
* Date: 01.05.2021
|
||||
* Time: 10:10
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
|
||||
class PropertyChannelContact extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'property_channel_contact';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
}
|
||||
22
app/Models/PropertyChannelCoupon.php
Normal file
22
app/Models/PropertyChannelCoupon.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelCoupon extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_coupon';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
protected $hidden = [];
|
||||
|
||||
}
|
||||
32
app/Models/PropertyChannelGroup.php
Normal file
32
app/Models/PropertyChannelGroup.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelGroup extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_group';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function channelGroupActiveChannels()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyChannelGroupChannelMapping','channel_group_id','id')->where('status',1);
|
||||
}
|
||||
}
|
||||
32
app/Models/PropertyChannelGroupChannelMapping.php
Normal file
32
app/Models/PropertyChannelGroupChannelMapping.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelGroupChannelMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_group_channel_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function channel()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyChannel",'id', 'channel_id')->select(['id', 'name', 'token' ]);
|
||||
}
|
||||
}
|
||||
74
app/Models/PropertyChannelMapping.php
Normal file
74
app/Models/PropertyChannelMapping.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->hasOne("App\Models\Property", 'id', 'property_id')->select(['id' , 'name']);
|
||||
}
|
||||
|
||||
public function channel()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyChannel", 'id', 'channel_id')->select(['id', 'parent_id', 'token','name', 'official_name', 'description', 'channel_category_id', 'country_code', 'country_code_group', 'currency_code', 'default_currency', 'logo', 'address', 'zip_code', 'email', 'phone', 'phone2', 'fax', 'contact', 'status']);
|
||||
}
|
||||
|
||||
public function channelBookingType()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyBookingType", 'id', 'property_booking_type_id')->select(['id', 'name', 'language_key', 'code', 'status']);
|
||||
}
|
||||
|
||||
public function channelAvailabilityType()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyAvailabilityType", 'id', 'property_availability_type_id')->select(['id', 'name', 'language_key', 'code', 'status']);
|
||||
}
|
||||
|
||||
public function channelRoomPricingType()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyRoomPricingType", 'id', 'property_room_pricing_type_id')->select(['id', 'name', 'language_key', 'code', 'status']);
|
||||
}
|
||||
|
||||
public function channelBookingPaymentType()
|
||||
{
|
||||
return $this->hasMany("App\Models\PropertyChannelBookingPaymentSetup", 'property_channel_mapping_id', 'id')->select(['id', 'property_channel_mapping_id', 'payment_type_id', 'cancellation_policy', 'is_affected_price', 'is_get_payment_data','action_type', 'value_type', 'value', 'is_selected', 'status']);
|
||||
}
|
||||
|
||||
public function channelContact()
|
||||
{
|
||||
return $this->hasMany("App\Models\PropertyChannelContact", 'property_channel_mapping_id', 'id')->select(['id', 'property_channel_mapping_id','name', 'email', 'status']);
|
||||
}
|
||||
|
||||
|
||||
public function channelTax()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyChannelTax", 'id', 'channel_tax_id')->select(['id', 'name', 'language_key', 'code', 'status']);
|
||||
}
|
||||
|
||||
public function currency()
|
||||
{
|
||||
return $this->hasOne("App\Models\Currency", 'code', 'currency_code')->select(['id', 'code', 'symbol', 'name', 'language_key', 'status']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelRoomRateCancellationPolicyMapping extends BaseModel
|
||||
{
|
||||
protected $table = 'property_channel_room_rate_cancellation_policy_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
public function propertyCancellationPolicy()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyCancellationPolicy', 'id', 'cancellation_policy_id')
|
||||
->select(['id', 'property_id', 'name', 'before_arrival', 'is_nonrefundable', 'is_free_cancellation', 'type', 'value', 'is_affected_price', 'affect_price_action_type', 'affect_price_type', 'affect_price_value', 'is_date_range', 'start_date', 'finish_date', 'status']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelRoomRatePricingPolicyAdultMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_room_rate_pricing_policy_adult_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function propertyPricingPolicyAdult()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPricingPolicyAdult', 'id', 'pricing_policy_adult_id')
|
||||
->select("id", "property_id", "name", "adult_action_type", "adult", "action_type", "type", "value", "reservation_start_date", "reservation_end_date", "status");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelRoomRatePricingPolicyChildMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_room_rate_pricing_policy_child_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
public function propertyPricingPolicyChild()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyPricingPolicyChild', 'id','pricing_policy_child_id')
|
||||
->select("id", "property_id", "name","adult", "child_order","child_age_start","child_age_end","type","value","reservation_start_date", "reservation_end_date","status");
|
||||
}
|
||||
|
||||
}
|
||||
33
app/Models/PropertyChannelTax.php
Normal file
33
app/Models/PropertyChannelTax.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyChannelTax extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_channel_tax';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
31
app/Models/PropertyCompetitorGroup.php
Normal file
31
app/Models/PropertyCompetitorGroup.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyCompetitorGroup extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_competitor_group';
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
public function property()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Property', 'property_id', 'id');
|
||||
}
|
||||
}
|
||||
22
app/Models/PropertyCompetitorGroupMapping.php
Normal file
22
app/Models/PropertyCompetitorGroupMapping.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyCompetitorGroupMapping extends BaseModel
|
||||
{
|
||||
protected $table = 'property_competitor_group_mapping';
|
||||
protected $primaryKey = 'id';
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'competitor_group_id',
|
||||
'property_id',
|
||||
'competitor_property_source',
|
||||
'competitor_property_key',
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
}
|
||||
28
app/Models/PropertyCompetitorMapping.php
Normal file
28
app/Models/PropertyCompetitorMapping.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyCompetitorMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_competitor_mapping';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
}
|
||||
29
app/Models/PropertyConfig.php
Normal file
29
app/Models/PropertyConfig.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyConfig extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_config';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
}
|
||||
138
app/Models/PropertyContact.php
Normal file
138
app/Models/PropertyContact.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyContact extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_contact';
|
||||
protected $appends = ['view_full_phone', 'view_full_mobile', 'view_full_mobile2', 'view_full_fax', 'formattedMobileNumber'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
const CHARACTER_LENGTH = 6;
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
|
||||
public function getViewFullPhoneAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null;
|
||||
|
||||
if(strpos($this->phone,'444') !== false) {
|
||||
$phoneNumber = $this->phone;
|
||||
preg_match_all('/(444).*/m', $this->phone, $matchesPhone, PREG_SET_ORDER, 0);
|
||||
$matchesPhone = reset($matchesPhone);
|
||||
$matchesPhone = reset($matchesPhone);
|
||||
$matchesPhone = str_replace(' ','', $matchesPhone);
|
||||
|
||||
$phoneNumber = substr($matchesPhone,0,3).' '.substr($matchesPhone,3,1).' '.substr($matchesPhone,4,3);
|
||||
|
||||
return $phoneNumber;
|
||||
}
|
||||
|
||||
if ($this->phone == null || $this->phone == "" || strlen($this->phone) < self::CHARACTER_LENGTH) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->phone_code) {
|
||||
$response = strpos($this->phone_code, '+') === false ? '+' . $this->phone_code . $this->phone : $this->phone_code . $this->phone;
|
||||
} else {
|
||||
$response = strpos($this->phone, '+') === false ? '+' . $this->phone : $this->phone;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getViewFullMobileAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null;
|
||||
|
||||
if ($this->mobile == null || $this->mobile == "" || strlen($this->mobile) < self::CHARACTER_LENGTH) {
|
||||
return null;
|
||||
}
|
||||
if ($this->mobile_code) {
|
||||
$response = strpos($this->mobile_code, '+') === false ? '+' . $this->mobile_code . $this->mobile : $this->mobile_code . $this->mobile;
|
||||
} else {
|
||||
$response = strpos($this->mobile, '+') === false ? '+' . $this->mobile : $this->mobile;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getViewFullMobile2Attribute()
|
||||
{
|
||||
try {
|
||||
$response = null;
|
||||
if ($this->mobile2 == null || $this->mobile2 == "" || strlen($this->mobile2) < self::CHARACTER_LENGTH) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($this->mobile2_code) {
|
||||
$response = strpos($this->mobile2_code, '+') === false ? '+' . $this->mobile2_code . $this->mobile2 : $this->mobile2_code . $this->mobile2;
|
||||
} else {
|
||||
$response = strpos($this->mobile2, '+') === false ? '+' . $this->mobile2 : $this->mobile2;
|
||||
}
|
||||
return $response;
|
||||
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getViewFullFaxAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null;
|
||||
if ($this->fax == null || $this->fax == "" || strlen($this->fax) < self::CHARACTER_LENGTH) {
|
||||
return null;
|
||||
}
|
||||
if ($this->fax_code) {
|
||||
$response = strpos($this->fax_code, '+') === false ? '+' . $this->fax_code . $this->fax : $this->fax_code . $this->fax;
|
||||
} else {
|
||||
$response = strpos($this->fax, '+') === false ? '+' . $this->fax : $this->fax;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getFormattedMobileNumberAttribute()
|
||||
{
|
||||
try {
|
||||
$mobilePhoneNumber = null;
|
||||
if ($this->mobile == null || $this->mobile == "" || strlen($this->mobile) < self::CHARACTER_LENGTH) {
|
||||
return null;
|
||||
}
|
||||
if ($this->mobile) {
|
||||
$this->mobile = preg_replace('/[^0-9,.]+/i', '', $this->mobile);
|
||||
$mobilePhoneNumber = $this->mobile_code . $this->mobile;
|
||||
}
|
||||
return $mobilePhoneNumber;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
36
app/Models/PropertyContent.php
Normal file
36
app/Models/PropertyContent.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyContent extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_content';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function PropertyContentCategories()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyContentCategory','id');
|
||||
}
|
||||
|
||||
}
|
||||
35
app/Models/PropertyContentCategory.php
Normal file
35
app/Models/PropertyContentCategory.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyContentCategory extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_content_category';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function propertyContentCategoryLocale()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyContentCategoryLocale','content_category_id', 'id');
|
||||
}
|
||||
}
|
||||
98
app/Models/PropertyExecutive.php
Normal file
98
app/Models/PropertyExecutive.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyExecutive extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_executive';
|
||||
protected $appends = ['view_full_phone', 'view_full_mobile', 'view_full_fax'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
const CHARACTER_LENGTH = 6;
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
public function getViewFullPhoneAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null ;
|
||||
if($this->phone == null || $this->phone == "" || strlen( $this->phone) < self::CHARACTER_LENGTH){
|
||||
return null ;
|
||||
}
|
||||
if($this->phone_code){
|
||||
$response = strpos($this->phone_code, '+') === false ? '+'.$this->phone_code.$this->phone : $this->phone_code.$this->phone;
|
||||
}else{
|
||||
$response = strpos($this->phone, '+') === false ? '+'.$this->phone : $this->phone;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getViewFullMobileAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null ;
|
||||
if($this->mobile == null || $this->mobile == "" || strlen( $this->mobile) < self::CHARACTER_LENGTH){
|
||||
return null ;
|
||||
}
|
||||
if($this->mobile_code){
|
||||
$response = strpos($this->mobile_code, '+') === false ? '+'.$this->mobile_code.$this->mobile : $this->mobile_code.$this->mobile;
|
||||
}else{
|
||||
$response = strpos($this->mobile, '+') === false ? '+'.$this->mobile : $this->mobile;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getViewFullFaxAttribute()
|
||||
{
|
||||
try {
|
||||
$response = null ;
|
||||
if($this->fax == null || $this->fax == "" || strlen( $this->fax) < self::CHARACTER_LENGTH){
|
||||
return null ;
|
||||
}
|
||||
if($this->fax_code){
|
||||
$response = strpos($this->fax_code, '+') === false ? '+'.$this->fax_code.$this->fax : $this->fax_code.$this->fax;
|
||||
}else{
|
||||
$response = strpos($this->fax, '+') === false ? '+'.$this->fax : $this->fax;
|
||||
}
|
||||
return $response;
|
||||
} catch (Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function executiveType()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyExecutiveType','id', 'executive_type_id')->select('id', 'name', 'language_key', 'icon');
|
||||
}
|
||||
|
||||
|
||||
/*public function PropertyContentCategories()
|
||||
{
|
||||
return $this->hasMany('App\Models\PropertyContentCategory','id');
|
||||
}*/
|
||||
}
|
||||
33
app/Models/PropertyExecutiveType.php
Normal file
33
app/Models/PropertyExecutiveType.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyExecutiveType extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_executive_type';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
37
app/Models/PropertyFact.php
Normal file
37
app/Models/PropertyFact.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyFact extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_fact';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
public function propertyFactParent()
|
||||
{
|
||||
return $this->hasOne('App\Models\PropertyFact','id', 'parent_id')->select('id', 'parent_id', 'name', 'language_key', 'title_language_key', 'order_number');
|
||||
}
|
||||
}
|
||||
33
app/Models/PropertyFactAttribute.php
Normal file
33
app/Models/PropertyFactAttribute.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyFactAttribute extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_fact_attribute';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
45
app/Models/PropertyFactMapping.php
Normal file
45
app/Models/PropertyFactMapping.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyFactMapping extends BaseModel
|
||||
{
|
||||
/**
|
||||
* The database table used by the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'property_fact_mapping';
|
||||
protected $appends = ['descriptionArray'];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes excluded from the model's JSON form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [];
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
function getDescriptionArrayAttribute()
|
||||
{
|
||||
$description = [];
|
||||
if (!empty($this->description)) {
|
||||
$description = json_decode($this->description, 1);
|
||||
}
|
||||
return $description;
|
||||
}
|
||||
|
||||
public function fact()
|
||||
{
|
||||
return $this->hasOne("App\Models\PropertyFact", 'id', 'fact_id')->select('id', 'parent_id', 'name', 'icon', 'language_key');
|
||||
}
|
||||
|
||||
}
|
||||
24
app/Models/PropertyGroup.php
Normal file
24
app/Models/PropertyGroup.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class PropertyGroup extends BaseModel
|
||||
{
|
||||
protected $table = 'property_group';
|
||||
protected $appends = [];
|
||||
|
||||
const CREATED_AT = 'created_at';
|
||||
const UPDATED_AT = 'updated_at';
|
||||
|
||||
protected $dateFormat = 'U';
|
||||
protected $guarded = [];
|
||||
|
||||
protected $hidden = [];
|
||||
|
||||
public function propertyGroupMapping(){
|
||||
return $this->hasMany('App\Models\PropertyGroupMapping','property_group_id', 'id')
|
||||
->select([ "id","property_id","property_group_id", "order_number", "status"])
|
||||
->where("status" , "=", 1);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user