科创券优化
This commit is contained in:
+13
-2
@@ -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})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user