Mail.php
1.1 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
<?php
namespace App\Models\Mail;
use App\Models\Base;
use App\Models\User\User;
class Mail extends Base
{
protected $table = 'gl_mail';
//自动维护create_at创建时间 updated_at修改时间
public $timestamps = true;
//连接数据库
// protected $connection = 'custom_mysql';
/**
* @param $value
* @remark :获取器userList参数处理
* @name :getUserListAttribute
* @author :lyh
* @method :post
* @time :2023/6/21 15:58
*/
public function getUserListName($values)
{
$str = '';
if(!empty($values)){
$arr = explode(',',$values);
$userModel = new User();
$list = $userModel->list(['id'=>['in',$arr]]);
foreach ($list as $v){
$str .= $v['name'].',';
}
}
return trim($str,',');
}
/**
* @param $value
* @remark :userList参数处理
* @name :getUserListAttribute
* @author :lyh
* @method :post
* @time :2023/6/21 15:58
*/
public function setUserList($values)
{
return ','.trim($values,',').',';
}
}