TaskFollow.php
886 字节
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
<?php
namespace App\Models\Task;
use App\Http\Logic\Aside\LoginLogic;
use App\Models\Base;
use App\Services\Facades\Upload;
class TaskFollow extends Base
{
//设置关联表名
protected $table = 'gl_task_follow';
const STATUS_WAIT = 0;
const STATUS_DONGING = 1;
const STATUS_DOWN = 2;
public static function statusMap(){
return [
self::STATUS_WAIT => '未开始',
self::STATUS_DONGING => '进行中',
self::STATUS_DOWN => '已完成',
];
}
public function setAttachmentAttribute($value){
$this->attributes['attachment'] = Upload::url2path($value);
}
public function getAttachmentAttribute($value){
return Upload::path2url($value);
}
public function setManageIdAttribute($value){
$this->attributes['manage_id'] = LoginLogic::manage('id');
}
}