列表显示第一个规格

This commit is contained in:
liyj 2025-11-20 09:36:21 +08:00
parent efe4d0124c
commit 29b4552e26

View File

@ -2076,6 +2076,20 @@ public class ShopProductBaseServiceImpl extends BaseServiceImpl<ShopProductBaseM
product_base_row.put("product_uniqid", product_info_row.get("product_uniqid"));
product_base_row.put("product_spec", product_info_row.get("product_spec"));
if(null!= product_info_row.get("product_spec")){
JSONArray jsonArray_spec = JSONObject.parseArray((String) product_info_row.get("product_spec"));
if(jsonArray_spec.size() > 0){
JSONObject jsonObject= (JSONObject) jsonArray_spec.get(0);
JSONArray jsonArray_item= (JSONArray) jsonObject.get("item");
if(jsonArray_item.size() > 0){
JSONObject jsonObjectItem= (JSONObject) jsonArray_item.get(0);
String itemSpec= (String) jsonObjectItem.get("name");
String product_name=product_base_row.get("product_name")+itemSpec;
product_base_row.put("product_name",product_name);
}
}
}
Integer product_sale_num = Convert.toInt(product_index_row.get("product_sale_num"));
// if (product_base_row != null) {