|
|
@@ -306,11 +306,12 @@ public class Controller extends BaseClass {
|
|
|
|
|
|
|
|
|
public Row getUser(long userid) {
|
|
|
- return dbConnect.runSqlQuery("select * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid=" + userid).get(0);
|
|
|
+ return getUser(userid, siteid);
|
|
|
}
|
|
|
|
|
|
public Row getUser(long userid, String siteid) {
|
|
|
- return dbConnect.runSqlQuery("select * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid=" + userid).get(0);
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select * from tenterprise_users where siteid='" + siteid + "' and tenterprise_userid=" + userid);
|
|
|
+ return rows.isEmpty() ? null : rows.get(0);
|
|
|
}
|
|
|
|
|
|
public RowsMap getUser(long userids[]) {
|
|
|
@@ -322,11 +323,13 @@ public class Controller extends BaseClass {
|
|
|
}
|
|
|
|
|
|
public Row getMainUser(long tagentsid) {
|
|
|
- return dbConnect.runSqlQuery("select * from tenterprise_users where siteid='" + siteid + "' and fisadministrator=1 and tagentsid=" + tagentsid).get(0);
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select * from tenterprise_users where siteid='" + siteid + "' and fisadministrator=1 and tagentsid=" + tagentsid);
|
|
|
+ return rows.isEmpty() ? null : rows.get(0);
|
|
|
}
|
|
|
|
|
|
public Row getAgent(long tagentsid) {
|
|
|
- return dbConnect.runSqlQuery("select * from tagents where siteid='" + siteid + "' and tagentsid=" + tagentsid).get(0);
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select * from tagents where siteid='" + siteid + "' and tagentsid=" + tagentsid);
|
|
|
+ return rows.isEmpty() ? null : rows.get(0);
|
|
|
}
|
|
|
|
|
|
/**
|