duxin 2 年 前
コミット
6b037e4695
1 ファイル変更3 行追加2 行削除
  1. 3 2
      entity/power/power.go

+ 3 - 2
entity/power/power.go

@@ -73,17 +73,18 @@ func HasAheadPower(userId string) bool {
 	if vipStatus != nil && vipStatus.Status > 0 {
 		return true
 	}
+	id, _ := primitive.ObjectIDFromHex(userId)
 	//查询权益
 	query := map[string]interface{}{
 		"$or": []map[string]interface{}{
 			{
-				"_id": primitive.ObjectIDFromHex(userId),
+				"_id": id,
 				"i_member_status": map[string]interface{}{
 					"$gt": 0,
 				},
 			},
 			{
-				"_id": primitive.ObjectIDFromHex(userId),
+				"_id": id,
 				"i_vip_status": map[string]interface{}{
 					"$gt": 0,
 				},