Quellcode durchsuchen

bugfix-呵呵改版

Aslee vor 3 Jahren
Ursprung
Commit
135692fb4f

+ 2 - 2
src/main/java/com/caimei/modules/hehe/service/HeheHomeTypeProductService.java

@@ -64,8 +64,8 @@ public class HeheHomeTypeProductService extends CrudService<HeheHomeTypeProductD
 	}
 
 	public Page<CmHeheProduct> findProductPage(Page<CmHeheProduct> productPage, CmHeheProduct product) {
-		List<Integer> productIds = heheHomeTypeProductDao.findHomeTypeProductIds();
-		product.setIds(productIds);
+		/*List<Integer> productIds = heheHomeTypeProductDao.findHomeTypeProductIds();
+		product.setIds(productIds);*/
 		product.setPage(productPage);
 		List<CmHeheProduct> productList = activityProductDao.findAllHeHeProduct(product);
 		String wwwServer = Global.getConfig("wwwServer");

+ 2 - 2
src/main/java/com/caimei/modules/hehe/web/HeheHomeTypeProductController.java

@@ -70,14 +70,14 @@ public class HeheHomeTypeProductController extends BaseController {
 		}
 		heheHomeTypeProductService.save(heheHomeTypeProduct);
 		addMessage(redirectAttributes, "保存商品成功");
-		return "redirect:"+Global.getAdminPath()+"/hehe/heheHomeTypeProduct/?repage";
+        return "redirect:" + Global.getAdminPath() + "/hehe/heheHomeTypeProduct/?repage&homeTypeId=" + heheHomeTypeProduct.getHomeTypeId();
 	}
 	
 	@RequestMapping(value = "delete")
 	public String delete(HeheHomeTypeProduct heheHomeTypeProduct, RedirectAttributes redirectAttributes) {
 		heheHomeTypeProductService.delete(heheHomeTypeProduct);
 		addMessage(redirectAttributes, "删除商品成功");
-		return "redirect:"+Global.getAdminPath()+"/hehe/heheHomeTypeProduct/?repage";
+        return "redirect:" + Global.getAdminPath() + "/hehe/heheHomeTypeProduct/?repage&homeTypeId=" + heheHomeTypeProduct.getHomeTypeId();
 	}
 
 	@ResponseBody

+ 3 - 1
src/main/resources/mappings/modules/hehe/HeheHomeTypeProductMapper.xml

@@ -76,7 +76,9 @@
 		</choose>
 	</select>
 	<select id="findHomeTypeProductIds" resultType="java.lang.Integer">
-		select productId from hehe_home_type_product;
+		select productId from hehe_home_type_product hhtp
+		    left join hehe_home_type hht on hhtp.homeTypeId = hht.id
+		where hht.id is not null;
 	</select>
 
 	<insert id="insert" parameterType="HeheHomeTypeProduct"  keyProperty="id" useGeneratedKeys="true">

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/hehe/heheHomeTypeProductList.jsp

@@ -190,7 +190,7 @@
 					<c:if test="${heheHomeTypeProduct.status ne 1 }">
 						<a href="javascript:;" onclick="updateStatus('1','${heheHomeTypeProduct.id}')">上架</a>
 					</c:if>
-					<a href="${ctx}/hehe/heheHomeTypeProduct/delete?id=${heheHomeTypeProduct.id}" onclick="return confirmx('确认要删除该商品吗?', this.href)">删除</a>
+					<a href="${ctx}/hehe/heheHomeTypeProduct/delete?id=${heheHomeTypeProduct.id}&homeTypeId=${heheHomeTypeProduct.homeTypeId}" onclick="return confirmx('确认要删除该商品吗?', this.href)">删除</a>
 				</td>
 			</tr>
 		</c:forEach>