EmailJoinUser.php
755 字节
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
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/**
* 关系表
* @time 2022/7/29 15:09
* Class EmailJoinUser
* @package App\Mail\Models
*/
class EmailJoinUser extends Model {
/**
* @param $user_id
* @param $email_id
* @return mixed
* @author:dc
* @time 2022/10/25 15:04
*/
public static function isBind($user_id,$email_id){
return static::where(['email_id'=>$email_id,'user_id'=>$user_id])->count();
}
/**
* @param $user_id
* @return mixed
* @author:dc
* @time 2022/10/25 15:04
*/
public static function getEmailIds($user_id){
return static::where('user_id',$user_id)->get(['email_id'])->pluck('email_id')->toArray();
}
}