Mails, Strono, filter
This commit is contained in:
parent
f53f17f9c1
commit
62e84637b6
99 changed files with 2409 additions and 474 deletions
|
|
@ -7,15 +7,19 @@
|
|||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Reliese\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class CustomerMail
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $booking_id
|
||||
* @property int $customer_id
|
||||
* @property int $lead_id
|
||||
* @property bool $is_answer
|
||||
* @property int $reply_id
|
||||
* @property string $email
|
||||
* @property string $subject
|
||||
* @property string $message
|
||||
* @property bool $send
|
||||
|
|
@ -26,28 +30,15 @@ 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 Lead $lead
|
||||
* @property Collection|CustomerFile[] $customer_files
|
||||
* @property Collection|CustomerMail[] $customer_mails
|
||||
*
|
||||
* @package App\Models
|
||||
* @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 whereBookingId($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 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 whereLeadId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CustomerMail whereMessage($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 whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class CustomerMail extends Model
|
||||
{
|
||||
|
|
@ -57,6 +48,8 @@ class CustomerMail extends Model
|
|||
'booking_id' => 'int',
|
||||
'customer_id' => 'int',
|
||||
'lead_id' => 'int',
|
||||
'is_answer' => 'bool',
|
||||
'reply_id' => 'int',
|
||||
'send' => 'bool',
|
||||
'fail' => 'bool'
|
||||
];
|
||||
|
|
@ -71,7 +64,9 @@ class CustomerMail extends Model
|
|||
'booking_id',
|
||||
'customer_id',
|
||||
'lead_id',
|
||||
'email',
|
||||
'is_answer',
|
||||
'reply_id',
|
||||
'email',
|
||||
'subject',
|
||||
'message',
|
||||
'send',
|
||||
|
|
@ -92,11 +87,27 @@ class CustomerMail extends Model
|
|||
return $this->belongsTo(Customer::class);
|
||||
}
|
||||
|
||||
public function customer_mail()
|
||||
{
|
||||
return $this->belongsTo(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
public function lead()
|
||||
{
|
||||
return $this->belongsTo(Lead::class);
|
||||
}
|
||||
|
||||
public function customer_files()
|
||||
{
|
||||
return $this->hasMany(CustomerFile::class);
|
||||
}
|
||||
|
||||
public function customer_mails()
|
||||
{
|
||||
return $this->hasMany(CustomerMail::class, 'reply_id');
|
||||
}
|
||||
|
||||
|
||||
public function getSentAtAttribute(){
|
||||
if(!$this->attributes['sent_at']){ return ""; }
|
||||
return Carbon::parse($this->attributes['sent_at'])->format(\Util::formatDateTimeDB());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue