Эх сурвалжийг харах

商户管理-修改审核状态接口

lcl 1 жил өмнө
parent
commit
7606921f9e

+ 34 - 0
Areas/Api/Controllers/v1/Main2/MerchantInfoController.cs

@@ -266,5 +266,39 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         }
         #endregion
 
+        #region 商户管理-修改审核状态
+        [Authorize]
+        public JsonResult SetStatus(string value)
+        {
+            value = PublicFunction.DesDecrypt(value);
+            JsonData data = JsonMapper.ToObject(value);
+            AppResultJson result = SetStatusDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
+        }
+        private AppResultJson SetStatusDo(string value)
+        {
+            JsonData data = JsonMapper.ToObject(value);
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
+            int Status = int.Parse(function.CheckInt(data["Status"].ToString()));
+            string Note = data["Note"].ToString();
+            MerchantInfo info = main2db.MerchantInfo.FirstOrDefault(m => m.Id == Id);
+            if(info != null)
+            {
+                info.QueryCount = 0;
+                info.Status = -1;
+            }
+            MerchantAddInfo addInfo = main2db.MerchantAddInfo.FirstOrDefault(m => m.Id == Id);
+            if(addInfo != null)
+            {
+                addInfo.QueryCount = 0;
+                addInfo.Status = -1;
+                addInfo.WeChatRemark = Note;
+            }
+            main2db.SaveChanges();
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
+        }
+        #endregion
+
     }
 }