ソースを参照

feat:增加字段

wangchuanjin 1 年間 前
コミット
4554a15712
3 ファイル変更12 行追加2 行削除
  1. 6 0
      openPower/config.json
  2. 2 0
      openPower/openPower.go
  3. 4 2
      public/entity/base_power.go

+ 6 - 0
openPower/config.json

@@ -85,6 +85,12 @@
 			"GoodsCode": "special_nosale_goods",
 			"GoodsSpecId": 24,
 			"All": {"bi_营销": "bi_yx"}
+		},
+		"znsj_jqr_use": {
+			"Name": "站内社交_机器人",
+			"GoodsCode": "special_nosale_goods",
+			"GoodsSpecId": 27,
+			"All": {"站内社交_机器人": "znsj_jqr_use"}
 		}
 	}
 }

+ 2 - 0
openPower/openPower.go

@@ -238,6 +238,8 @@ func main() {
 					powerReq.EntId = identity.EntId
 				} else {
 					powerReq.AccountId = identity.AccountId
+					powerReq.EntAccountId = identity.EntAccountId
+					powerReq.EntId = identity.EntId
 				}
 				r, err := c.PowerHandle(context.Background(), powerReq)
 				if err != nil {

+ 4 - 2
public/entity/base_power.go

@@ -2,6 +2,7 @@ package entity
 
 import (
 	"database/sql"
+	"log"
 	"strings"
 	"time"
 
@@ -128,7 +129,7 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, ac
 					if v.Power_count == -1 && Base_ent_empower.Count(appid, v.Function_code, ent_id) == 0 {
 						empower_values = append(empower_values, appid, ent_id, 0, v.Function_code, start_time)
 					} else if v.Power_count > 0 {
-						wait_empower_values = append(wait_empower_values, appid, v.Id, ent_id, start_time, end_time, use_count, v.Power_count, v.Limit_strategy, start_time)
+						wait_empower_values = append(wait_empower_values, appid, v.Id, v.Function_code, ent_id, start_time, end_time, use_count, v.Power_count, v.Limit_strategy, start_time)
 					}
 				}
 			}
@@ -145,9 +146,10 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, ac
 		}
 		ok3 := true
 		if len(wait_empower_values) > 0 {
-			v5, v6 := Mysql_BaseService.InsertBatchByTx(tx, "base_ent_wait_empower", []string{"appid", "goods_spec_power_id", "ent_id", "start_time", "end_time", "use_count", "empower_count", "limit_strategy", "create_time"}, wait_empower_values)
+			v5, v6 := Mysql_BaseService.InsertBatchByTx(tx, "base_ent_wait_empower", []string{"appid", "goods_spec_power_id", "function_code", "ent_id", "start_time", "end_time", "use_count", "empower_count", "limit_strategy", "create_time"}, wait_empower_values)
 			ok3 = v5 > 0 && v6 > 0
 		}
+		log.Println(ok1 && ok2 && v1 > 0 && v2 > 0 && ok3)
 		return ok1 && ok2 && v1 > 0 && v2 > 0 && ok3
 	})
 }