|
@@ -111,9 +111,23 @@ public class FadGoods extends Controller {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ Rows attachmentRows = Attachment.get(this, "sa_fadid", sa_fadid);
|
|
|
+
|
|
|
sa_fadids.add(sa_fadid);
|
|
|
for (Long id : sa_fadids) {
|
|
|
listSQL.add(FadHelper.getIsOnSalesUpdateSQL(this, id).getSQL());
|
|
|
+ for (Row attachmentRow : attachmentRows) {
|
|
|
+ InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
|
|
|
+ insertSQL.setSiteid(siteid);
|
|
|
+ insertSQL.setUniqueid(createTableID("sys_attachment_links"));
|
|
|
+ insertSQL.setValue("usetype", attachmentRow.getString("usetype"));
|
|
|
+ insertSQL.setValue("attachmentid", attachmentRow.getLong("attachmentid"));
|
|
|
+ insertSQL.setValue("sequence", 1);
|
|
|
+ insertSQL.setValue("ownertable", sa_fad);
|
|
|
+ insertSQL.setValue("ownerid", id);
|
|
|
+ insertSQL.setWhere("not exists(select 1 from sys_attachment_links where attachmentid=" + attachmentRow.getLong("attachmentid") + " and ownertable='sa_fad' and siteid='" + siteid + "' and ownerid=" + id + " )");
|
|
|
+ listSQL.add(insertSQL.getSQL());
|
|
|
+ }
|
|
|
}
|
|
|
//上下架
|
|
|
dbConnect.runSqlUpdate(listSQL);
|