Mail and Booking
This commit is contained in:
parent
62e84637b6
commit
5daea268f7
250 changed files with 5377 additions and 1473 deletions
|
|
@ -8,11 +8,11 @@ namespace App\Models;
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CustomerMail
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $customer_id
|
||||
|
|
@ -20,8 +20,15 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @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 $travel_country_id
|
||||
* @property bool $draft
|
||||
* @property bool $important
|
||||
* @property bool $send
|
||||
* @property bool $fail
|
||||
* @property string $error
|
||||
|
|
@ -30,28 +37,73 @@ use Reliese\Database\Eloquent\Model;
|
|||
* @property Carbon $delivered_at
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property Booking $booking
|
||||
* @property Customer $customer
|
||||
* @property CustomerMail $customer_mail
|
||||
* @property TravelCountry $travel_country
|
||||
* @property Lead $lead
|
||||
* @property Collection|CustomerFile[] $customer_files
|
||||
* @property Collection|CustomerMail[] $customer_mails
|
||||
*
|
||||
* @package App\Models
|
||||
* @property-read int|null $customer_files_count
|
||||
* @property-read int|null $customer_mails_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereBcc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereBookingId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCc($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereCustomerId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDeliveredAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDir($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereDraft($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereEmail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereError($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereFail($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereImportant($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereIsAnswer($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereMessage($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereRecipient($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereReplyId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereScheduledAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSentAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereSubject($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereTravelCountryId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class CustomerMail extends Model
|
||||
{
|
||||
protected $table = 'customer_mails';
|
||||
|
||||
public $dir_types = [
|
||||
0 => 'Reisender',
|
||||
1 => 'Agentur',
|
||||
2 => 'Flug',
|
||||
3 => 'Versicherung',
|
||||
11 => 'Entwurf',
|
||||
12 => 'Papierkorb',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'booking_id' => 'int',
|
||||
'customer_id' => 'int',
|
||||
'lead_id' => 'int',
|
||||
'is_answer' => 'bool',
|
||||
'reply_id' => 'int',
|
||||
'dir' => 'int',
|
||||
'travel_country_id' => 'int',
|
||||
'draft' => 'bool',
|
||||
'important' => 'bool',
|
||||
'send' => 'bool',
|
||||
'fail' => 'bool'
|
||||
'fail' => 'bool',
|
||||
'recipient' => 'array',
|
||||
'cc' => 'array',
|
||||
'bcc' => 'array'
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
|
|
@ -67,8 +119,15 @@ class CustomerMail extends Model
|
|||
'is_answer',
|
||||
'reply_id',
|
||||
'email',
|
||||
'recipient',
|
||||
'cc',
|
||||
'bcc',
|
||||
'subject',
|
||||
'message',
|
||||
'dir',
|
||||
'travel_country_id',
|
||||
'draft',
|
||||
'important',
|
||||
'send',
|
||||
'fail',
|
||||
'error',
|
||||
|
|
@ -92,6 +151,11 @@ class CustomerMail extends Model
|
|||
return $this->belongsTo(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function travel_country()
|
||||
{
|
||||
return $this->belongsTo(TravelCountry::class);
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
|
|
@ -107,6 +171,9 @@ class CustomerMail extends Model
|
|||
return $this->hasMany(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function getSentAtRaw(){
|
||||
return $this->attributes['sent_at'];
|
||||
}
|
||||
|
||||
public function getSentAtAttribute(){
|
||||
if(!$this->attributes['sent_at']){ return ""; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue