Ver código fonte

奖励调整+配置

lcl 6 dias atrás
pai
commit
d118e3a1fd

+ 2 - 2
Model/Database/PriPrizeInField.cs

@@ -69,14 +69,14 @@ namespace Model
         /// <summary>
         /// 匹配方式
         /// </summary>
-        [SugarColumn(ColumnDescription = "匹配方式", Length = 20, ColumnName = "field_query_model")]
+        [SugarColumn(ColumnDescription = "匹配方式", Length = 50, ColumnName = "field_query_model")]
         public string? fieldQueryModel { get; set; }
 
 
         /// <summary>
         /// 匹配值
         /// </summary>
-        [SugarColumn(ColumnDescription = "匹配值", Length = 50, ColumnName = "field_query_value")]
+        [SugarColumn(ColumnDescription = "匹配值", Length = 500, ColumnName = "field_query_value")]
         public string? fieldQueryValue { get; set; }
 
 

+ 1 - 1
Model/Database/PriQueryField.cs

@@ -76,7 +76,7 @@ namespace Model
         /// <summary>
         /// 匹配方式
         /// </summary>
-        [SugarColumn(ColumnDescription = "匹配方式", Length = 20, ColumnName = "field_query_model")]
+        [SugarColumn(ColumnDescription = "匹配方式", Length = 50, ColumnName = "field_query_model")]
         public string? fieldQueryModel { get; set; }
 
 

+ 23 - 2
Util/PrizeDo.cs

@@ -1828,7 +1828,7 @@ namespace Util
                         }
                         else if(project.requestMode == "mq")
                         {}
-                        else
+                        else if(project.requestMode == "db")
                         {
                             prizeToDatabase(projectId, sub.id, content, condiDic, prizeAmt, startData); //入库
                         }
@@ -2108,10 +2108,31 @@ namespace Util
                     {
                         fieldQueryValue = GetQueryTableData(condiDic, fieldQueryValue);
                     }
-                    else if(fieldQueryModel == "querystart_list_field_field")
+                    else if(fieldQueryModel == "querystart_list_field")
                     {
                         fieldQueryValue = GetStartData(startData, fieldQueryValue);
                     }
+                    else if(fieldQueryModel == "query_all_field")
+                    {
+                        if (fieldQueryValue.Contains("+") || fieldQueryValue.Contains("-") || fieldQueryValue.Contains("*") || fieldQueryValue.Contains("/") || fieldQueryValue.Contains("(") || fieldQueryValue.Contains(")"))
+                        {
+                            string[] texts = fieldQueryValue.Split(new char[] { '+', '-', '*', '/', '(', ')' });
+                            foreach (string text in texts)
+                            {
+                                string val = GetStartData(startData, text);
+                                if(string.IsNullOrEmpty(val)) val = GetQueryTableData(condiDic, text);
+                                fieldQueryValue = fieldQueryValue.Replace(text, val);
+                            }
+                            DataTable dt = new();
+                            fieldQueryValue = dt.Compute(fieldQueryValue, "false").ToString();
+                        }
+                        else
+                        {
+                            string val = GetStartData(startData, fieldQueryValue);
+                            if(string.IsNullOrEmpty(val)) val = GetQueryTableData(condiDic, fieldQueryValue);
+                            fieldQueryValue = val;
+                        }
+                    }
                     else if(fieldQueryModel == "fixed_value")
                     {
                         fieldQueryValue = GetExpressionVal(fieldQueryValue);