|
@@ -533,15 +533,22 @@ public class agents extends Controller {
|
|
|
Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
if (rows.isNotEmpty()) {
|
|
|
Long sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
- rows = dbConnect.runSqlQuery("SELECT * from sa_accountbalance WHERE sys_enterpriseid = " + sys_enterpriseid + " and siteid='" + siteid + "' and sa_accountclassid=" + sa_accountclassid);
|
|
|
+ sql = "SELECT * from sa_accountbalance WHERE sys_enterpriseid = " + sys_enterpriseid + " and siteid='" + siteid + "' and sa_accountclassid=" + sa_accountclassid;
|
|
|
+ if (isorder == 1) {
|
|
|
+ sql = sql + " and isorder=1";
|
|
|
+ }
|
|
|
+ rows = dbConnect.runSqlQuery(sql);
|
|
|
if (rows.isNotEmpty()) {
|
|
|
Long sa_accountbalanceid = rows.get(0).getLong("sa_accountbalanceid");
|
|
|
dbConnect.runSqlUpdate("UPDATE sa_accountbalance SET balance=" + rebateBalance + " WHERE sa_accountbalanceid= '" + sa_accountbalanceid + "' and siteid='" + siteid + "'");
|
|
|
}
|
|
|
}
|
|
|
+ sql = "SELECT accountno,accountname,sa_accountclassid,isrebate from sa_accountclass WHERE siteid = '" + siteid + "' and isused = 1";
|
|
|
|
|
|
-
|
|
|
- rows = dbConnect.runSqlQuery("SELECT accountno,accountname,sa_accountclassid,isrebate from sa_accountclass WHERE siteid = '" + siteid + "' and isused = 1");
|
|
|
+ if (isorder == 1) {
|
|
|
+ sql = sql + " and isorder=1";
|
|
|
+ }
|
|
|
+ rows = dbConnect.runSqlQuery(sql);
|
|
|
Rows balanceRows = dbConnect.runSqlQuery("SELECT sa_accountbalanceid,balance, creditquota,changeuserid,changeby,changedate,sa_accountclassid from sa_accountbalance WHERE siteid = '" + siteid + "' and sys_enterpriseid = " + sys_enterpriseid);
|
|
|
|
|
|
for (Row row : rows) {
|