SystemConfig.php
1.26 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
<?php
namespace common\models;
use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;
/**
* 系统配置
* This is the model class for table "{{%system_config}}".
*/
class SystemConfig extends ActiveRecord
{
const APPEAL_NOTICE_MEMBERS = 'apeal_notice_members';
const DISPATCH_CUSTOMER_SERVICE = 'dispatch_customer_service';
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%system_config}}';
}
/**
* @return array
*/
public function behaviors()
{
return [
'time' => [
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
]
];
}
/**
* 获取质保单指定客服人员信息
* @return array|mixed
*/
public static function getAppealServiceMembers()
{
$configRow = self::findOne(['config_key' => self::APPEAL_NOTICE_MEMBERS]);
if ($configRow && isset($configRow->values)) {
$memberConfig = $configRow->values;
$members = json_decode($memberConfig, true);
if ($members) {
return $members;
}
}
return [];
}
}