TP5 whereOr 查询(闭包传参)

public function loginCheck($data=null){
    $result = model('admin')->where(function ($query) use ($data) {
        $query->where('phone',$data['login_name'])->where('passwd',$data['passwd']);
    })->whereOr(function ($query) use ($data) {
        $query->where('login_name',$data['login_name'])->where('passwd',$data['passwd']);
    })->select();
    return $result;
}

你可能感兴趣的:(TP5 whereOr 查询(闭包传参))