瀏覽代碼

没做太多修改

Administrator 2 年之前
父節點
當前提交
8cf9182748
共有 82 個文件被更改,包括 15 次插入5 次删除
  1. 1 1
      configs/config.go
  2. 12 3
      data/dao/DetailDao.go
  3. 二進制
      file/resources/1716885931268.jpg
  4. 二進制
      file/resources/1716885931991.jpg
  5. 二進制
      file/resources/1716885932032.jpg
  6. 二進制
      file/resources/1716885932108.jpg
  7. 二進制
      file/resources/1716885932986.jpg
  8. 二進制
      file/resources/1716885933030.jpg
  9. 二進制
      file/resources/1716885933083.jpg
  10. 二進制
      file/resources/1716885933127.jpg
  11. 二進制
      file/resources/1716885933164.jpg
  12. 二進制
      file/resources/1716885933287.jpg
  13. 二進制
      file/resources/1716885933766.jpg
  14. 二進制
      file/resources/1716885933852.jpg
  15. 二進制
      file/resources/1716885933874.jpg
  16. 二進制
      file/resources/1716885933908.jpg
  17. 二進制
      file/resources/1716885933959.jpg
  18. 二進制
      file/resources/1716885934040.jpg
  19. 二進制
      file/resources/1716885934102.jpg
  20. 二進制
      file/resources/1716885934128.jpg
  21. 二進制
      file/resources/1716885934161.jpg
  22. 二進制
      file/resources/1716885934192.jpg
  23. 二進制
      file/resources/1716885934218.jpg
  24. 二進制
      file/resources/1716885934252.jpg
  25. 二進制
      file/resources/1716885934307.jpg
  26. 二進制
      file/resources/1716885934339.jpg
  27. 二進制
      file/resources/1716885934369.jpg
  28. 二進制
      file/resources/1716885934402.jpg
  29. 二進制
      file/resources/1716885934431.jpg
  30. 二進制
      file/resources/1716885934474.jpg
  31. 二進制
      file/resources/1716885934508.jpg
  32. 二進制
      file/resources/1716885935000.jpg
  33. 二進制
      file/resources/1716885935234.jpg
  34. 二進制
      file/resources/1716885935338.jpg
  35. 二進制
      file/resources/1716885935378.jpg
  36. 二進制
      file/resources/1716885935508.jpg
  37. 二進制
      file/resources/1716885935530.jpg
  38. 二進制
      file/resources/1716885935568.jpg
  39. 二進制
      file/resources/1716885935596.jpg
  40. 二進制
      file/resources/1716885935652.jpg
  41. 二進制
      file/resources/1716885935684.jpg
  42. 二進制
      file/resources/1716885935707.jpg
  43. 二進制
      file/resources/1716885935734.jpg
  44. 二進制
      file/resources/1716885935758.jpg
  45. 二進制
      file/resources/1716885935799.jpg
  46. 二進制
      file/resources/1716885935826.jpg
  47. 二進制
      file/resources/1716885935942.jpg
  48. 二進制
      file/resources/1716885935973.jpg
  49. 二進制
      file/resources/1716885936008.jpg
  50. 二進制
      file/resources/1716885936043.jpg
  51. 二進制
      file/resources/1716885936198.jpg
  52. 二進制
      file/resources/1716885936358.jpg
  53. 二進制
      file/resources/1716885936394.jpg
  54. 二進制
      file/resources/1716885936428.jpg
  55. 二進制
      file/resources/1716885936465.jpg
  56. 二進制
      file/resources/1716885936496.jpg
  57. 二進制
      file/resources/1716885936528.jpg
  58. 二進制
      file/resources/1716885936554.jpg
  59. 二進制
      file/resources/1716885936584.jpg
  60. 二進制
      file/resources/1716885936611.jpg
  61. 二進制
      file/resources/1716885936635.jpg
  62. 二進制
      file/resources/1716885936659.jpg
  63. 二進制
      file/resources/1716885936687.jpg
  64. 二進制
      file/resources/1716885936719.jpg
  65. 二進制
      file/resources/1716885936752.jpg
  66. 二進制
      file/resources/1716885936786.jpg
  67. 二進制
      file/resources/1716885936822.jpg
  68. 二進制
      file/resources/1716885936882.jpg
  69. 二進制
      file/resources/1716885936918.jpg
  70. 二進制
      file/resources/1716885936954.jpg
  71. 二進制
      file/resources/1716885937000.jpg
  72. 二進制
      file/resources/1716885937144.jpg
  73. 二進制
      file/resources/1716885937180.jpg
  74. 二進制
      file/resources/1716885937214.jpg
  75. 二進制
      file/resources/1716885937249.jpg
  76. 二進制
      file/resources/1716885937283.jpg
  77. 二進制
      file/resources/1716885937392.jpg
  78. 二進制
      file/resources/1716885937430.jpg
  79. 二進制
      file/resources/1716885937469.jpg
  80. 二進制
      file/resources/1716885937556.jpg
  81. 二進制
      file/resources/1716885937621.jpg
  82. 2 1
      router/DetailRouter.go

+ 1 - 1
configs/config.go

@@ -90,7 +90,7 @@ func ConfigInit() {
 
 	Config = config
 	fmt.Println("xorm 数据库orm框架初始化成功")
-	PayConfigInit()
+	//PayConfigInit()
 }
 func ConfigInitByUrl(configUrl string) {
 	//获取项目的执行路径

+ 12 - 3
data/dao/DetailDao.go

@@ -41,7 +41,14 @@ A:
 		commodityAreaIds = append(commodityAreaIds, sku.CommodityAreaId)
 		commodityAreaIdsString = fmt.Sprint(commodityAreaIdsString, ",", sku.CommodityAreaId)
 	}
-	commodityAreaIdsString = commodityAreaIdsString[1:]
+	if len(skus) == 0 {
+		return detailVo, nil
+	}
+
+	if len(commodityAreaIdsString) > 1 {
+		commodityAreaIdsString = commodityAreaIdsString[1:]
+	}
+
 	fmt.Println("=============================>", commodityAreaIdsString)
 	//================查询goods========================
 	var goods domain.Goods
@@ -74,7 +81,7 @@ A:
 	//=================查询goods_CommodityArea========================
 	var goodsCommodityArea domain.GoodsCommodityArea
 	rows, err = configs.Engine.Table("goods_commodity_area").
-		Where(" FIND_IN_SET(goods_commodity_area.id,?) and goods_id = ?", commodityAreaIdsString, goods.Id).
+		Where(" FIND_IN_SET(goods_commodity_area.id,?)", commodityAreaIdsString).
 		Rows(&goodsCommodityArea)
 	if err != nil {
 		println("查询goods_CommodityArea失败", err)
@@ -96,7 +103,9 @@ B:
 		introductionIds = append(introductionIds, goodsCommodityArea.DetailIntroductionId)
 		introductionIdString = fmt.Sprint(introductionIdString, ",", goodsCommodityArea.DetailIntroductionId)
 	}
-	introductionIdString = introductionIdString[1:]
+	if len(introductionIdString) > 1 {
+		introductionIdString = introductionIdString[1:]
+	}
 	fmt.Println("=============================>", introductionIdString)
 	//=================查询goods_introduction========================
 	var goodsIntroduction domain.GoodsIntroduction

二進制
file/resources/1716885931268.jpg


二進制
file/resources/1716885931991.jpg


二進制
file/resources/1716885932032.jpg


二進制
file/resources/1716885932108.jpg


二進制
file/resources/1716885932986.jpg


二進制
file/resources/1716885933030.jpg


二進制
file/resources/1716885933083.jpg


二進制
file/resources/1716885933127.jpg


二進制
file/resources/1716885933164.jpg


二進制
file/resources/1716885933287.jpg


二進制
file/resources/1716885933766.jpg


二進制
file/resources/1716885933852.jpg


二進制
file/resources/1716885933874.jpg


二進制
file/resources/1716885933908.jpg


二進制
file/resources/1716885933959.jpg


二進制
file/resources/1716885934040.jpg


二進制
file/resources/1716885934102.jpg


二進制
file/resources/1716885934128.jpg


二進制
file/resources/1716885934161.jpg


二進制
file/resources/1716885934192.jpg


二進制
file/resources/1716885934218.jpg


二進制
file/resources/1716885934252.jpg


二進制
file/resources/1716885934307.jpg


二進制
file/resources/1716885934339.jpg


二進制
file/resources/1716885934369.jpg


二進制
file/resources/1716885934402.jpg


二進制
file/resources/1716885934431.jpg


二進制
file/resources/1716885934474.jpg


二進制
file/resources/1716885934508.jpg


二進制
file/resources/1716885935000.jpg


二進制
file/resources/1716885935234.jpg


二進制
file/resources/1716885935338.jpg


二進制
file/resources/1716885935378.jpg


二進制
file/resources/1716885935508.jpg


二進制
file/resources/1716885935530.jpg


二進制
file/resources/1716885935568.jpg


二進制
file/resources/1716885935596.jpg


二進制
file/resources/1716885935652.jpg


二進制
file/resources/1716885935684.jpg


二進制
file/resources/1716885935707.jpg


二進制
file/resources/1716885935734.jpg


二進制
file/resources/1716885935758.jpg


二進制
file/resources/1716885935799.jpg


二進制
file/resources/1716885935826.jpg


二進制
file/resources/1716885935942.jpg


二進制
file/resources/1716885935973.jpg


二進制
file/resources/1716885936008.jpg


二進制
file/resources/1716885936043.jpg


二進制
file/resources/1716885936198.jpg


二進制
file/resources/1716885936358.jpg


二進制
file/resources/1716885936394.jpg


二進制
file/resources/1716885936428.jpg


二進制
file/resources/1716885936465.jpg


二進制
file/resources/1716885936496.jpg


二進制
file/resources/1716885936528.jpg


二進制
file/resources/1716885936554.jpg


二進制
file/resources/1716885936584.jpg


二進制
file/resources/1716885936611.jpg


二進制
file/resources/1716885936635.jpg


二進制
file/resources/1716885936659.jpg


二進制
file/resources/1716885936687.jpg


二進制
file/resources/1716885936719.jpg


二進制
file/resources/1716885936752.jpg


二進制
file/resources/1716885936786.jpg


二進制
file/resources/1716885936822.jpg


二進制
file/resources/1716885936882.jpg


二進制
file/resources/1716885936918.jpg


二進制
file/resources/1716885936954.jpg


二進制
file/resources/1716885937000.jpg


二進制
file/resources/1716885937144.jpg


二進制
file/resources/1716885937180.jpg


二進制
file/resources/1716885937214.jpg


二進制
file/resources/1716885937249.jpg


二進制
file/resources/1716885937283.jpg


二進制
file/resources/1716885937392.jpg


二進制
file/resources/1716885937430.jpg


二進制
file/resources/1716885937469.jpg


二進制
file/resources/1716885937556.jpg


二進制
file/resources/1716885937621.jpg


+ 2 - 1
router/DetailRouter.go

@@ -28,10 +28,11 @@ func GetDetailData(c *gin.Context) {
 	}
 
 	vo, err := dao.SelectGoodsDetailById(int64(id))
-	if err != nil {
+	if err != nil || vo.DetailSkuVo.NowSkuId == 0 {
 		c.JSON(200, CreateResultError(400, "查询失败"))
 		return
 	}
+
 	c.JSON(200, CreateResultData(vo))
 }