| 9 | |
| 10 | |
| 11 | class Project extends Model |
| 12 | { |
| 13 | |
| 14 | protected $table = 'chihe_project'; |
| 15 | protected $fillable = [ |
| 16 | 'id', |
| 17 | 'title', |
| 18 | 'app_id', |
| 19 | 'created_at', |
| 20 | 'image', |
| 21 | 'status', |
| 22 | 'description', |
| 23 | 'path', |
| 24 | 'sort', |
| 25 | 'updated_at' |
| 26 | ]; |
| 27 | |
| 28 | static function showStatus($type = null) |
| 29 | { |
| 30 | $map = [ |
| 31 | 1 => '显示', |
| 32 | 2 => '隐藏', |
| 33 | ]; |
| 34 | |
| 35 | if ($type) { |
| 36 | return $map[$type] ?? ''; |
| 37 | } |
| 38 | return $map; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * 获取设置 |
| 43 | */ |
| 44 | function getImageAttribute($value) |
| 45 | { |
| 46 | if (strpos($value,'http') === false) { |
| 47 | return url('/') . '/storage/'. $value; |
| 48 | } else { |
| 49 | return $value; |
| 50 | } |
| 51 | |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * 设置 |
| 56 | */ |
| 57 | function set() |
| 58 | { |
| 59 | |
| 60 | } |
| 61 | } |
| 62 |
nothing calls this directly
no outgoing calls
no test coverage detected