mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
1. 框架更新至5.8,并且其涉及代码进行修改; 2. 对支付的alipay组件针对php7.2/3进行修改; 3. 重构了节点信息获取逻辑;现在为实时请求; 4. 代码小细节和命名规范
62 lines
1.8 KiB
PHP
62 lines
1.8 KiB
PHP
<?php
|
||
|
||
namespace App\Http\Models;
|
||
|
||
use Eloquent;
|
||
use Illuminate\Database\Eloquent\Builder;
|
||
use Illuminate\Database\Eloquent\Model;
|
||
use Illuminate\Support\Carbon;
|
||
|
||
/**
|
||
* 营销
|
||
* Class Marketing
|
||
*
|
||
* @package App\Http\Models
|
||
* @mixin Eloquent
|
||
* @property int $id
|
||
* @property int $type 类型:1-邮件群发、2-订阅渠道群发
|
||
* @property string $receiver 接收者
|
||
* @property string $title 标题
|
||
* @property string $content 内容
|
||
* @property string|null $error 错误信息
|
||
* @property int $status 状态:-1-失败、0-待发送、1-成功
|
||
* @property Carbon $created_at
|
||
* @property Carbon $updated_at
|
||
* @property-read mixed $status_label
|
||
* @method static Builder|Marketing newModelQuery()
|
||
* @method static Builder|Marketing newQuery()
|
||
* @method static Builder|Marketing query()
|
||
* @method static Builder|Marketing whereContent($value)
|
||
* @method static Builder|Marketing whereCreatedAt($value)
|
||
* @method static Builder|Marketing whereError($value)
|
||
* @method static Builder|Marketing whereId($value)
|
||
* @method static Builder|Marketing whereReceiver($value)
|
||
* @method static Builder|Marketing whereStatus($value)
|
||
* @method static Builder|Marketing whereTitle($value)
|
||
* @method static Builder|Marketing whereType($value)
|
||
* @method static Builder|Marketing whereUpdatedAt($value)
|
||
*/
|
||
class Marketing extends Model
|
||
{
|
||
protected $table = 'marketing';
|
||
protected $primaryKey = 'id';
|
||
protected $appends = ['status_label'];
|
||
|
||
function getStatusLabelAttribute()
|
||
{
|
||
$status_label = '';
|
||
switch($this->attributes['status']){
|
||
case -1:
|
||
$status_label = '失败';
|
||
break;
|
||
case 0:
|
||
$status_label = '待推送';
|
||
break;
|
||
case 1:
|
||
$status_label = '成功';
|
||
break;
|
||
}
|
||
|
||
return $status_label;
|
||
}
|
||
} |