浏览代码

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/services into dev

wangfei 6 年前
父节点
当前提交
8d3e0fc793
共有 2 个文件被更改,包括 12 次插入1 次删除
  1. 0
    1
      controllers/luckdraw/luckdraw.go
  2. 12
    0
      service/cases/signin.go

+ 0
- 1
controllers/luckdraw/luckdraw.go 查看文件

@@ -171,7 +171,6 @@ func (c *LuckDrawController) SaveShareRecord() {
171 171
 	}
172 172
 
173 173
 	if from == nil || from.CustomerId == "" {
174
-		utils.LogError("分享人信息不存在: " + err.Error())
175 174
 		c.ResponseData(
176 175
 			errIgnore,
177 176
 			"分享人信息不存在",

+ 12
- 0
service/cases/signin.go 查看文件

@@ -3,6 +3,7 @@ package cases
3 3
 import (
4 4
 	"errors"
5 5
 	"spaceofcheng/services/models/cases"
6
+	"spaceofcheng/services/models/customer"
6 7
 	"spaceofcheng/services/models/marketing"
7 8
 	"spaceofcheng/services/models/model"
8 9
 	"spaceofcheng/services/utils"
@@ -15,6 +16,7 @@ import (
15 16
 type SigninServ struct {
16 17
 	ctx     *utils.Context
17 18
 	dao     *cases.SigninDAO
19
+	custDAO *customer.CustomerDAO
18 20
 	marDao  *marketing.MarketingDAO
19 21
 	caseDao *cases.CaseDAO
20 22
 }
@@ -24,6 +26,7 @@ func NewSigninServ(ctx *utils.Context) *SigninServ {
24 26
 	return &SigninServ{
25 27
 		ctx:     ctx,
26 28
 		dao:     cases.NewSigninDAO(ctx),
29
+		custDAO: customer.NewCustomerDAO(ctx),
27 30
 		marDao:  marketing.NewMarketingDAO(ctx),
28 31
 		caseDao: cases.NewCaseDAO(ctx),
29 32
 	}
@@ -98,6 +101,15 @@ func (s *SigninServ) AddSignin(signin model.TaCheckinRecord, caseId string, acti
98 101
 		return nil, err
99 102
 	}
100 103
 
104
+	if user.Phone == "" {
105
+		user.Phone = signin.Phone
106
+
107
+		// 如果有错误, 只记录不返回
108
+		if err := s.custDAO.UpdateCustomer(&user, []string{"phone"}); err != nil {
109
+			utils.LogError("更新用户手机失败: " + err.Error())
110
+		}
111
+	}
112
+
101 113
 	return &info, err
102 114
 }
103 115