|
@@ -835,14 +835,15 @@ public class payorder extends Controller {
|
|
|
|
|
|
|
|
Long counts = content.getLongValue("counts");
|
|
Long counts = content.getLongValue("counts");
|
|
|
|
|
|
|
|
- JSONArray sa_agentsids = content.getJSONArray("sa_agentsids");
|
|
|
|
|
- if (sa_agentsids.size() == 0) {
|
|
|
|
|
- sa_agentsids = dbConnect.runSqlQuery("SELECT sa_agentsid FROM sa_agents t1 WHERE t1.siteid='" + siteid + "' AND t1.`status`='启用'").toJsonArray("sa_agentsid");
|
|
|
|
|
|
|
+ JSONArray items = content.getJSONArray("items");
|
|
|
|
|
+ if (items.size() == 0) {
|
|
|
|
|
+ items = dbConnect.runSqlQuery("SELECT sa_agentsid,sys_enterpriseid FROM sa_agents t1 WHERE t1.siteid='" + siteid + "' AND t1.`status`='启用'").toJsonArray();
|
|
|
}
|
|
}
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (int i = 0; i < counts; i++) {
|
|
for (int i = 0; i < counts; i++) {
|
|
|
- for (Object obj : sa_agentsids) {
|
|
|
|
|
|
|
+ for (Object obj : items) {
|
|
|
|
|
+ JSONObject object = (JSONObject) obj;
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_paycoupon");
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_paycoupon");
|
|
|
insertSQL.setValue("sys_paycouponid", createTableID("sys_paycoupon"));
|
|
insertSQL.setValue("sys_paycouponid", createTableID("sys_paycoupon"));
|
|
|
insertSQL.setValue("siteid", siteid);
|
|
insertSQL.setValue("siteid", siteid);
|
|
@@ -851,7 +852,8 @@ public class payorder extends Controller {
|
|
|
insertSQL.setValue("days", content.getLongValue("days"));
|
|
insertSQL.setValue("days", content.getLongValue("days"));
|
|
|
insertSQL.setValue("amount", content.getBigDecimal("amount"));
|
|
insertSQL.setValue("amount", content.getBigDecimal("amount"));
|
|
|
insertSQL.setValue("type", content.getStringValue("type"));
|
|
insertSQL.setValue("type", content.getStringValue("type"));
|
|
|
- insertSQL.setValue("sa_agentsid", obj);
|
|
|
|
|
|
|
+ insertSQL.setValue("sys_enterpriseid", object.getStringValue("sys_enterpriseid"));
|
|
|
|
|
+ insertSQL.setValue("sa_agentsid", object.getStringValue("sa_agentsid"));
|
|
|
sqlList.add(insertSQL.getSQL());
|
|
sqlList.add(insertSQL.getSQL());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|