|
...
|
...
|
@@ -3,6 +3,7 @@ |
|
|
|
namespace App\Models\Mail;
|
|
|
|
|
|
|
|
use App\Models\Base;
|
|
|
|
use App\Models\User\User;
|
|
|
|
|
|
|
|
class Mail extends Base
|
|
|
|
{
|
|
...
|
...
|
@@ -11,4 +12,40 @@ class Mail extends Base |
|
|
|
public $timestamps = true;
|
|
|
|
//连接数据库
|
|
|
|
// protected $connection = 'custom_mysql';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $value
|
|
|
|
* @remark :获取器userList参数处理
|
|
|
|
* @name :setUserListAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/21 15:57
|
|
|
|
*/
|
|
|
|
public function setUserListAttribute($value)
|
|
|
|
{
|
|
|
|
// 在设置 user_list 属性时,进行处理并保存
|
|
|
|
$this->attributes['user_list'] = ','.trim($value,',').',';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $value
|
|
|
|
* @remark :生成器userList参数处理
|
|
|
|
* @name :getUserListAttribute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/21 15:58
|
|
|
|
*/
|
|
|
|
public function getUserListAttribute($value)
|
|
|
|
{
|
|
|
|
$str = '';
|
|
|
|
if(!empty($value)){
|
|
|
|
$arr = explode(',',$value);
|
|
|
|
$userModel = new User();
|
|
|
|
$list = $userModel->list(['id'=>['in',$arr]]);
|
|
|
|
foreach ($list as $v){
|
|
|
|
$str .= $v['name'].',';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return trim($str,',');// 将属性值转为小写并保存
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|