Fewo Mails / Booking Country Services
This commit is contained in:
parent
b9c26d06d0
commit
48a6eb2282
154 changed files with 7761 additions and 1643 deletions
189
app/Models/CustomerFewoMail.php
Normal file
189
app/Models/CustomerFewoMail.php
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CustomerFewoMail
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $travel_user_booking_fewo_id
|
||||
* @property int $travel_user_id
|
||||
* @property bool $is_answer
|
||||
* @property int $reply_id
|
||||
* @property string $email
|
||||
* @property string $recipient
|
||||
* @property string $cc
|
||||
* @property string $bcc
|
||||
* @property string $subject
|
||||
* @property string $message
|
||||
* @property int $dir
|
||||
* @property int $subdir
|
||||
* @property bool $draft
|
||||
* @property bool $important
|
||||
* @property bool $send
|
||||
* @property bool $fail
|
||||
* @property string $error
|
||||
* @property Carbon $sent_at
|
||||
* @property Carbon $scheduled_at
|
||||
* @property Carbon $delivered_at
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property CustomerFewoMail $customer_fewo_mail
|
||||
* @property TravelUserBookingFewo $travel_user_booking_fewo
|
||||
* @property TravelUser $travel_user
|
||||
* @property Collection|CustomerFewoFile[] $customer_fewo_files
|
||||
* @property Collection|CustomerFewoMail[] $customer_fewo_mails
|
||||
* @package App\Models
|
||||
* @property-read int|null $customer_fewo_files_count
|
||||
* @property-read int|null $customer_fewo_mails_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereBcc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereCc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereDeliveredAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereDir($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereDraft($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereError($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereFail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereImportant($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereIsAnswer($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereRecipient($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereReplyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereScheduledAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereSend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereSentAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereSubdir($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereSubject($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereTravelUserBookingFewoId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereTravelUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerFewoMail whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
* @property-read \App\Models\TravelUserBookingFewo $booking
|
||||
* @property-read \App\Models\TravelUser $customer
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\CustomerFewoFile[] $customer_files
|
||||
* @property-read int|null $customer_files_count
|
||||
* @property-read \App\Models\CustomerFewoMail|null $customer_mail
|
||||
*/
|
||||
class CustomerFewoMail extends Model
|
||||
{
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'customer_fewo_mails';
|
||||
|
||||
protected $casts = [
|
||||
'travel_user_booking_fewo_id' => 'int',
|
||||
'travel_user_id' => 'int',
|
||||
'is_answer' => 'bool',
|
||||
'reply_id' => 'int',
|
||||
'dir' => 'int',
|
||||
'subdir' => 'int',
|
||||
'draft' => 'bool',
|
||||
'important' => 'bool',
|
||||
'send' => 'bool',
|
||||
'fail' => 'bool',
|
||||
'recipient' => 'array',
|
||||
'cc' => 'array',
|
||||
'bcc' => 'array'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'sent_at',
|
||||
'scheduled_at',
|
||||
'delivered_at'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'travel_user_booking_fewo_id',
|
||||
'travel_user_id',
|
||||
'is_answer',
|
||||
'reply_id',
|
||||
'email',
|
||||
'recipient',
|
||||
'cc',
|
||||
'bcc',
|
||||
'subject',
|
||||
'message',
|
||||
'dir',
|
||||
'subdir',
|
||||
'draft',
|
||||
'important',
|
||||
'send',
|
||||
'fail',
|
||||
'error',
|
||||
'sent_at',
|
||||
'scheduled_at',
|
||||
'delivered_at'
|
||||
];
|
||||
|
||||
public function customer_fewo_mail()
|
||||
{
|
||||
return $this->belongsTo(CustomerFewoMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function customer_mail()
|
||||
{
|
||||
return $this->belongsTo(CustomerFewoMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function travel_user_booking_fewo()
|
||||
{
|
||||
return $this->belongsTo(TravelUserBookingFewo::class);
|
||||
}
|
||||
|
||||
public function booking()
|
||||
{
|
||||
return $this->belongsTo(TravelUserBookingFewo::class);
|
||||
}
|
||||
|
||||
public function travel_user()
|
||||
{
|
||||
return $this->belongsTo(TravelUser::class);
|
||||
}
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo(TravelUser::class, 'travel_user_id');
|
||||
}
|
||||
|
||||
public function customer_fewo_files()
|
||||
{
|
||||
return $this->hasMany(CustomerFewoFile::class);
|
||||
}
|
||||
|
||||
public function customer_files()
|
||||
{
|
||||
return $this->hasMany(CustomerFewoFile::class, 'customer_fewo_mail_id');
|
||||
}
|
||||
|
||||
public function customer_fewo_mails()
|
||||
{
|
||||
return $this->hasMany(CustomerFewoMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function getSentAtRaw(){
|
||||
return $this->attributes['sent_at'];
|
||||
}
|
||||
|
||||
public function getSentAtAttribute(){
|
||||
if(!$this->attributes['sent_at']){ return ""; }
|
||||
return Carbon::parse($this->attributes['sent_at'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
|
||||
public function getCreatedAtAttribute(){
|
||||
if(!$this->attributes['created_at']){ return ""; }
|
||||
return Carbon::parse($this->attributes['created_at'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue