38 lines
912 B
PHP
38 lines
912 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class KeysApply extends Model
|
|
{
|
|
|
|
public function getIsPrintTextAttribute()
|
|
{
|
|
switch ($this->is_print) {
|
|
case 0:
|
|
return '<span style="color:blue">否</span>';
|
|
break;
|
|
case 1:
|
|
return '<span style="color:green">是</span>';
|
|
break;
|
|
}
|
|
}
|
|
|
|
protected function getStatusTextAttribute()
|
|
{
|
|
if ($this->status == 0) {
|
|
return '<span style="color: green">申请中</span>';
|
|
} elseif ($this->status == 1) {
|
|
return '<span style="color: orangered">已生成</span>';
|
|
} elseif ($this->status == 2) {
|
|
return '<span style="color: orangered">已驳回</span>';
|
|
} else {
|
|
return $this->status;
|
|
}
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(\App\User::class);
|
|
}
|
|
}
|