Visit.php
670 字节
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
<?php
namespace App\Models\Visit;
use App\Models\Base;
/**
* Class Visit
* @package App\Models
* @author zbj
* @date 2023/5/22
*/
class Visit extends Base
{
//设置关联表名
protected $table = 'gl_customer_visit';
//连接数据库
protected $connection = 'custom_mysql';
protected $appends = ['device_text'];
public static function deviceMap(){
return [
1 => 'PC',
2 => '移动端'
];
}
/**
* @return string
* @author zbj
* @date 2023/5/22
*/
public function getDeviceTextAttribute(){
return self::deviceMap()[$this->device_port] ?? '';
}
}