|
@@ -62,8 +62,20 @@ func (this *ChartController) Collection() {
|
|
|
}
|
|
|
mobile := user.Mobile
|
|
|
uid := user.UserId
|
|
|
+ pageSize, _ := this.GetInt("PageSize")
|
|
|
+ currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
+ var startSize int
|
|
|
+ if pageSize <= 0 {
|
|
|
+ pageSize = utils.PageSize20
|
|
|
+ }
|
|
|
+ if currentIndex <= 0 {
|
|
|
+ currentIndex = 1
|
|
|
+ }
|
|
|
+ startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
resp := new(models.HomeChartListItem)
|
|
|
if mobile == "" {
|
|
|
+ page := paging.GetPaging(currentIndex, pageSize, 0)
|
|
|
+ resp.Paging = page
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|
|
@@ -73,16 +85,7 @@ func (this *ChartController) Collection() {
|
|
|
} else {
|
|
|
resp.IsBindingMobile = true
|
|
|
}
|
|
|
- pageSize, _ := this.GetInt("PageSize")
|
|
|
- currentIndex, _ := this.GetInt("CurrentIndex")
|
|
|
- var startSize int
|
|
|
- if pageSize <= 0 {
|
|
|
- pageSize = utils.PageSize20
|
|
|
- }
|
|
|
- if currentIndex <= 0 {
|
|
|
- currentIndex = 1
|
|
|
- }
|
|
|
- startSize = utils.StartIndex(currentIndex, pageSize)
|
|
|
+
|
|
|
//list, err, total := services.GetChartCollectionByApi(mobile, pageSize, (currentIndex-1)*pageSize)
|
|
|
//if err != nil {
|
|
|
// br.Msg = "获取图表分类失败!"
|
|
@@ -177,8 +180,8 @@ func (this *ChartController) Detail() {
|
|
|
return
|
|
|
}
|
|
|
detail.IsCollection = GetIsCollectionChart
|
|
|
- if detail.CollectionNum > 0 {
|
|
|
- detail.IsCollection = true
|
|
|
+ if detail.IsCollection {
|
|
|
+ err = models.RemoveChartCollect(user.UserId, chartId)
|
|
|
}
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|