Adding subscriber device search

This commit is contained in:
stephb9959
2022-04-22 11:40:40 -07:00
parent a76a98c3f1
commit d8106d5d19

View File

@@ -195,9 +195,11 @@ namespace OpenWifi {
std::string Query;
if(Prefix[0]=='*') {
Query = fmt::format(" operatorId={} and right(serialNumber,{})='{}' ", operatorId, Prefix.size()-1, Prefix.substr(1));
Query = fmt::format(" operatorId={} and (right(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
operatorId, Prefix.size()-1, Prefix.substr(1), Prefix.size()-1, Prefix.substr(1));
} else {
Query = fmt::format(" operatorId={} and left(serialNumber,{})='{}' ", operatorId, Prefix.size(), Prefix);
Query = fmt::format(" operatorId={} and (left(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
operatorId, Prefix.size(), Prefix, Prefix.size(), Prefix);
}
std::vector<ProvObjects::SubscriberDevice> SubDevices;