|
@@ -114,13 +114,20 @@ public class promotion extends Controller {
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
|
|
ArrayList ids = rows.toArrayList("itemid", new ArrayList<>());
|
|
ArrayList ids = rows.toArrayList("itemid", new ArrayList<>());
|
|
|
|
|
+ //默认商品图片
|
|
|
|
|
+ Rows defaultImageRows = getAttachmentUrl("system", (long) 1, "defaultImage");
|
|
|
// 附件
|
|
// 附件
|
|
|
RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
|
|
RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
|
|
|
//商品领域
|
|
//商品领域
|
|
|
RowsMap tradefieldRowsMap = beans.Item.Item.getTradefieldRowsMap(this, ids);
|
|
RowsMap tradefieldRowsMap = beans.Item.Item.getTradefieldRowsMap(this, ids);
|
|
|
|
|
|
|
|
for (Row row : rows) {
|
|
for (Row row : rows) {
|
|
|
- row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
|
|
|
|
+ if ((attRowsMap.getOrDefault(row.getString("itemid"), new Rows())).isEmpty()) {
|
|
|
|
|
+ row.put("attinfos", defaultImageRows);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
}
|
|
}
|
|
|
|
|
|