1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\SoftDeletes;
- class EmailQueue extends Model
- {
- use SoftDeletes;
- protected $table = 'email_queues';
- protected $fillable = ['batch_id','m_address','m_subject', 'm_body','m_status','error_message','m_sendtime'];
- public function getMSendtimeAttribute($value)
- {
- return $value ? date('Y-m-d H:i:s', $value) : null;
- }
- public function emailBatchs()
- {
- return $this->belongsTo(EmailBatch::class, 'batch_id')->withDefault(['name'=>'无批次']);
- }
- }
|