Browse Source

Merge branch 'develop' of k.zhang/duoduo into master

k.zhang 4 years ago
parent
commit
f2ff47a885
1 changed files with 2 additions and 1 deletions
  1. 2 1
      apis/user/user.pid.get.go

+ 2 - 1
apis/user/user.pid.get.go

@@ -29,7 +29,7 @@ func PidGet(c *gin.Context) {
 	pid.OpenID = inData.OpenId
 	//sqlData.OpenID = inData.OpenId
 	val, err := pid.Get()
-	if err != nil {
+	if err != nil && err.Error() != "record not found" {
 		app.Error(c, 500, err, err.Error())
 		return
 	}
@@ -89,6 +89,7 @@ func PidGet(c *gin.Context) {
 		//插入pid
 		pid.OpenID = inData.OpenId
 		pid.PidStatus = 1 //拼多多
+		pid.Pid = pidOut.PIDGenerateResponse.PIDList[0].PID
 		pid.UpdateTime = tools.GetCurrntTimeStr()
 		pid.CreateTime = tools.GetCurrntTimeStr()
 		pid.Create()