EmailJoinUser.php 755 字节
<?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();
    }


}