|
@@ -407,8 +407,24 @@ func (this *UserController) Detail() {
|
|
|
if detail.Headimgurl == "" {
|
|
|
detail.Headimgurl = utils.DefaultHeadimgurl
|
|
|
}
|
|
|
- detail.UserCardType = 1 //权益卡类型
|
|
|
- detail.UserCardEndDate = time.Now().AddDate(0, 0, 1).Format(utils.FormatDateTime) // 结束时间
|
|
|
+
|
|
|
+ if user.Mobile != "" {
|
|
|
+ userCard, err := order.GetCygxOrderUserCardDetailByMobile(user.Mobile)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ br.Msg = "获取信息失败"
|
|
|
+ br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if userCard != nil {
|
|
|
+ if userCard.CardType == "日卡" {
|
|
|
+ detail.UserCardType = 1 //权益卡类型
|
|
|
+ detail.UserCardEndDate = userCard.EndDate.Format(utils.FormatDateTime)
|
|
|
+ } else {
|
|
|
+ detail.UserCardType = 2
|
|
|
+ detail.UserCardEndDate = userCard.EndDate.Format(utils.FormatDate)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
br.Msg = "获取成功"
|