RepairOrderStatus.php
1.11 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
namespace domain\order;
use Yii;
use domain\order\models\RepairOrder as RepairOrderModel;
/**
* 维修订单状态
*/
class RepairOrderStatus
{
const WORKING = 1; //维修中
const FINISH = 2; // 维修完成
/**
* @param $index
* @return string
*/
static function getEnLabel($index = '')
{
$arr = [
self::WORKING => "working",
self::FINISH => "finish",
];
if ('' === $index) {
return $arr;
}
if (isset($arr[$index])) {
return $arr[$index];
} else {
return '';
}
}
/**
* @param string $index
* @return array|string
*/
static function getLabels($index = '')
{
$arr = [
self::WORKING => "维修中",
self::FINISH => "维修完成",
];
if ('' === $index) {
return $arr;
}
if (isset($arr[$index])) {
return $arr[$index];
} else {
return '';
}
}
}