科创券优化

This commit is contained in:
2022-05-17 12:31:47 +08:00
parent 771b02bd61
commit f6f48a3f8d
7 changed files with 73 additions and 47 deletions
+13 -2
View File
@@ -42,6 +42,17 @@ var CouponCtr = Ctr{
data.Put("coupon_user.status", status)
}
specMap := Map{"AND": data}
if status == 0 {
specMap.Put("ORDER", "coupon_user.status ASC,coupon_user.effective_end_time ASC,coupon_user.create_time DESC")
}
if status == 1 {
specMap.Put("ORDER", "coupon_user.use_time DESC")
}
if status == 2 {
specMap.Put("ORDER", "coupon_user.effective_end_time DESC")
}
count := that.Db.Count("coupon_user", Map{"AND": data})
res := that.Db.Page(page, pageSize).PageSelect("coupon_user",
@@ -49,8 +60,8 @@ var CouponCtr = Ctr{
"coupon_user.code_no,coupon_user.effective_start_time,coupon_user.effective_end_time,coupon_user.status,"+
"coupon.coupon_amount,coupon.coupon_type,coupon.name,"+
"coupon.description",
Map{"AND": data,
"ORDER": "coupon_user.create_time DESC"})
specMap,
)
that.Display(0, Map{"total": count, "data": res})
},
}