您需要
user_meta为每个要匹配的属性加入一次。
SELECt u.*FROM users AS uJOIN user_meta AS m1 ON u.id = m1.userIDJOIN user_meta AS m2 ON u.id = m2.userIDWHERe m1.meta_key = 'companyID' AND m1.meta_value = :companyIDAND m2.meta_key = 'user_type' AND m2.meta_value = 'staff'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)