Quellcode durchsuchen

获取用户账户信息增加积分和今日是否已签到出参

zhou.xiaoning vor 3 Jahren
Ursprung
Commit
26b674ee6b
4 geänderte Dateien mit 41 neuen und 0 gelöschten Zeilen
  1. 8 0
      docs/docs.go
  2. 8 0
      docs/swagger.json
  3. 6 0
      docs/swagger.yaml
  4. 19 0
      models/account.go

+ 8 - 0
docs/docs.go

@@ -40745,6 +40745,10 @@ const docTemplate = `{
                     "description": "创建人",
                     "type": "integer"
                 },
+                "curscore": {
+                    "description": "积分",
+                    "type": "integer"
+                },
                 "hasauth": {
                     "description": "是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝",
                     "type": "integer"
@@ -40753,6 +40757,10 @@ const docTemplate = `{
                     "description": "是否匿名下单 - 0:否 1:是",
                     "type": "integer"
                 },
+                "issigned": {
+                    "description": "今日是否已签到",
+                    "type": "boolean"
+                },
                 "maxinvestornum": {
                     "description": "最大用户数(经纪会员下投资者个数)",
                     "type": "integer"

+ 8 - 0
docs/swagger.json

@@ -40736,6 +40736,10 @@
                     "description": "创建人",
                     "type": "integer"
                 },
+                "curscore": {
+                    "description": "积分",
+                    "type": "integer"
+                },
                 "hasauth": {
                     "description": "是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝",
                     "type": "integer"
@@ -40744,6 +40748,10 @@
                     "description": "是否匿名下单 - 0:否 1:是",
                     "type": "integer"
                 },
+                "issigned": {
+                    "description": "今日是否已签到",
+                    "type": "boolean"
+                },
                 "maxinvestornum": {
                     "description": "最大用户数(经纪会员下投资者个数)",
                     "type": "integer"

+ 6 - 0
docs/swagger.yaml

@@ -17660,12 +17660,18 @@ definitions:
       creatorid:
         description: 创建人
         type: integer
+      curscore:
+        description: 积分
+        type: integer
       hasauth:
         description: 是否已实名认证 - 0:未认证 1:已认证 2:已提交(待审核) 3:已拒绝
         type: integer
       isanonymous:
         description: 是否匿名下单 - 0:否 1:是
         type: integer
+      issigned:
+        description: 今日是否已签到
+        type: boolean
       maxinvestornum:
         description: 最大用户数(经纪会员下投资者个数)
         type: integer

+ 19 - 0
models/account.go

@@ -213,6 +213,10 @@ type Useraccount struct {
 	Canrecommend     int32     `json:"canrecommend"  xorm:"CANRECOMMEND"`         // 是否可推荐 - 0:不可 1;可
 
 	TodayRefercount int `json:"todayrefercount" xorm:"-"` // 今日推荐人数
+
+	CURSCORE int64 `json:"curscore" xorm:"-"` // 积分
+
+	IsSigned bool `json:"issigned" xorm:"-"` // 今日是否已签到
 }
 
 // TableName is USERACCOUNT
@@ -646,6 +650,21 @@ func GetUserAccount(userID int) (*Useraccount, error) {
 	}
 	userAccount.TodayRefercount = t.TodayRefercount
 
+	// 当前积分
+	type tmp1 struct {
+		CURSCORE int64 `json:"curscore" xorm:"CURSCORE"` // 期末积分
+	}
+	t1 := new(tmp1)
+	sql = fmt.Sprintf("select t.CURSCORE from THJ_USERSCORE t where t.USERID = %v", userAccount.Userid)
+	if _, err := engine.SQL(sql).Get(t); err != nil {
+		return nil, err
+	}
+	userAccount.CURSCORE = t1.CURSCORE
+
+	// 今日是否已签到
+	p := new(Thjsignin)
+	userAccount.IsSigned, _ = engine.Where("userid = ?", userAccount.Userid).And("tradedate = to_char(sysdate, 'yyyymmdd')").Get(&p)
+
 	return &userAccount, nil
 }