EmailSendJobStatu.php
954 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
 * 邮件发送任务,状态
 * @author:dc
 * @time 2022/11/9 11:17
 * Class EmailSendJob
 * @package App\Http\Mail\Models
 */
class EmailSendJobStatu extends Model{
    const STATUS_WAIT = 0; // 等待发送
    const STATUS_SUCCESS = 1; // 发送成功
    const STATUS_ERROR = 2; // 发送失败
    const STATUS_STOP = 3; // 暂停发送
    static $status_text = [
        self::STATUS_WAIT =>  '等待',
        self::STATUS_SUCCESS =>  '成功',
        self::STATUS_ERROR =>  '失败',
        self::STATUS_STOP =>  '暂停',
    ];
    public function getStatusTextAttribute()
    {
        return static::$status_text[$this->status];
    }
    public function getErrorAttribute($val)
    {
        return $val ? json_decode($val,true) : [];
    }
    public function getLinksAttribute($val)
    {
        return $val ? json_decode($val,true) : [];
    }
}