更新代码
This commit is contained in:
37
app/Models/KeysApply.php
Normal file
37
app/Models/KeysApply.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user