Bläddra i källkod

创客-我的-个人资料中的姓名头像从客小爽拿

lcl 1 år sedan
förälder
incheckning
440284c044

+ 33 - 52
Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs

@@ -140,7 +140,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId && m.Status == 2);
+            IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId && (m.Status == 2 || m.QueryCount == 2));
             DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
             int TotalCount = query.Count();
             int ActCount = query.Count(m => m.ActivationDate == today);
@@ -407,7 +407,6 @@ namespace MySystem.Areas.Api.Controllers.v1
         }
         public List<Dictionary<string, object>> MerchantByStatusDo(string value)
         {
-            // value = "{\"PageSize\":10,\"PageNum\":1,\"UserId\":\"13\",\"Status\":0,\"SearchKey\":\"\"}";
             JsonData data = JsonMapper.ToObject(value);
             string SearchKey = data["SearchKey"].ToString();
             int Status = int.Parse(function.CheckInt(data["Status"].ToString()));
@@ -415,14 +414,14 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId && m.QueryCount == 0);
+            IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId);
             if (Status > 0)
             {
                 if (Status == 1) Status = 0;
                 if (Status == 2) Status = -1;
                 if (Status == 3) Status = 1;
-                if (Status == 3) Status = 2;
-                query = query.Where(m => m.Status == Status);
+                if (Status == 4) Status = 2;
+                query = query.Where(m => (m.Status == Status || m.QueryCount == Status));
             }
             if (PageNum == 1)
             {
@@ -440,7 +439,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 curData.Add("Name", subdata.Name); //名称
                 curData.Add("Id", subdata.Id); //Id
                 curData.Add("CreateDate", subdata.CreateDate == null ? "" : subdata.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //CreateDate
-                curData.Add("Status", subdata.Status); //Status
+                curData.Add("Status", GetMainStatusName(AddInfo.QueryCount, AddInfo.Status)); //Status
                 curData.Add("MainType", AddInfo.SubjectType); //主体类型
                 dataList.Add(curData);
             }
@@ -467,7 +466,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             MerchantInfo query = MerchantInfoDbconn.Instance.Get(Id) ?? new MerchantInfo();
             MerchantAddInfo addInfo = MerchantAddInfoDbconn.Instance.Get(Id) ?? new MerchantAddInfo();
             Obj.Add("Name", query.Name); //名称
-            Obj.Add("Status", query.Status); //状态
             Obj.Add("CreateDate", query.CreateDate == null ? "" : query.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //提交时间
             List<Dictionary<string, object>> AuditResult = new List<Dictionary<string, object>>();
 
@@ -475,58 +473,19 @@ namespace MySystem.Areas.Api.Controllers.v1
             WeChat.Add("Name", "微信");
             WeChat.Add("Status", addInfo.Status);
             WeChat.Add("DoTime", addInfo.UpdateDate == null ? "" : addInfo.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
-            if (addInfo.Status == -1)
-            {
-                string Season = addInfo.SeoDescription;
-                Season = Season.Substring(Season.IndexOf("WeChat:") + 7);
-                Season = Season.Substring(0, Season.LastIndexOf(";"));
-                WeChat.Add("Season", Season);
-            }
-            else
-            { 
-                WeChat.Add("Season", "");
-            }
-            if (addInfo.Status == 1)
-            {
-                string SignUrl = addInfo.SeoKeyword;
-                SignUrl = SignUrl.Substring(SignUrl.IndexOf("WeChat:") + 7);
-                SignUrl = SignUrl.Substring(0, SignUrl.LastIndexOf(";"));
-                WeChat.Add("SignUrl", SignUrl);
-            }
-            else
-            { 
-                WeChat.Add("SignUrl", "");
-            }
+            WeChat.Add("Season", addInfo.WeChatRemark);
+            WeChat.Add("SignUrl", addInfo.WeChatSignUrl);
             AuditResult.Add(WeChat);
 
             Dictionary<string, object> Alipay = new Dictionary<string, object>();
             Alipay.Add("Name", "支付宝");
             Alipay.Add("Status", addInfo.QueryCount);
             Alipay.Add("DoTime", addInfo.UpdateDate == null ? "" : addInfo.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
-            if (addInfo.QueryCount == -1)
-            {
-                string Season = addInfo.SeoDescription;
-                Season = Season.Substring(Season.IndexOf("Alipay:") + 7);
-                Season = Season.Substring(0, Season.IndexOf(";"));
-                Alipay.Add("Season", Season);
-            }
-            else
-            { 
-                Alipay.Add("Season", "");
-            }
-            if (addInfo.QueryCount == 1)
-            { 
-                string SignUrl = addInfo.SeoKeyword;
-                SignUrl = SignUrl.Substring(SignUrl.IndexOf("Alipay:") + 7);
-                SignUrl = SignUrl.Substring(0, SignUrl.IndexOf(";"));
-                Alipay.Add("SignUrl", SignUrl);
-            }
-            else
-            { 
-                Alipay.Add("SignUrl", "");
-            }
+            Alipay.Add("Season", addInfo.AlipayRemark);
+            Alipay.Add("SignUrl", addInfo.AlipaySignUrl);
             AuditResult.Add(Alipay);
 
+            Obj.Add("Status", GetMainStatusName(addInfo.QueryCount, query.Status)); //状态
             Obj.Add("AuditResult", AuditResult); //审核结果
             return Obj;
         }
@@ -739,10 +698,32 @@ namespace MySystem.Areas.Api.Controllers.v1
             Obj.Add("Mobile", query.Mobile); //手机号
             Obj.Add("IsAuth", query.IsAuth); //是否认证
             Obj.Add("Logo", DefaultPic(query.Logo)); //Logo图片
-            Obj.Add("Status", merchantAddInfo.Status);
+            Obj.Add("Status", GetMainStatusName(merchantAddInfo.QueryCount, merchantAddInfo.Status));
+            Obj.Add("AlipayStatus", merchantAddInfo.QueryCount);
+            Obj.Add("WeChatStatus", merchantAddInfo.Status);
             Obj.Add("CreateDate", query.CreateDate == null ? "" : query.CreateDate.Value.ToString("yyyy-MM-dd"));
             return Obj;
         }
+        private string GetMainStatusName(int AlipayStatus, int WeChatStatus)
+        {
+            if(AlipayStatus == 0 && WeChatStatus == 0) return "待审核";
+            if(AlipayStatus == 0 && WeChatStatus == -1) return "部分未通过";
+            if(AlipayStatus == -1 && WeChatStatus == 0) return "部分未通过";
+            if(AlipayStatus == 0 && WeChatStatus == 1) return "部分待签约";
+            if(AlipayStatus == 1 && WeChatStatus == 0) return "部分待签约";
+            if(AlipayStatus == 0 && WeChatStatus == 2) return "部分已通过";
+            if(AlipayStatus == 2 && WeChatStatus == 0) return "部分已通过";
+            if(AlipayStatus == -1 && WeChatStatus == -1) return "审核未通过";
+            if(AlipayStatus == -1 && WeChatStatus == 1) return "部分未通过";
+            if(AlipayStatus == 1 && WeChatStatus == -1) return "部分未通过";
+            if(AlipayStatus == -1 && WeChatStatus == 2) return "部分未通过";
+            if(AlipayStatus == 2 && WeChatStatus == -1) return "部分未通过";
+            if(AlipayStatus == 1 && WeChatStatus == 1) return "待签约";
+            if(AlipayStatus == 1 && WeChatStatus == 2) return "部分待签约";
+            if(AlipayStatus == 2 && WeChatStatus == 1) return "部分待签约";
+            if(AlipayStatus == 2 && WeChatStatus == 2) return "已通过";
+            return "";
+        }
         #endregion
 
 

+ 2 - 2
Areas/Api/Controllers/v1/MainServer/UsersController.cs

@@ -40,9 +40,9 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-            Users query = UsersDbconn.Instance.Get(Id) ?? new Users();
+            KxsMainModels.Users query = kxsdb.Users.FirstOrDefault(m => m.Id == Id) ?? new KxsMainModels.Users();
             string IdString = Id.ToString();
-            Obj.Add("RealName", DefaultRealName(query)); //真实姓名
+            Obj.Add("RealName", query.RealName); //真实姓名
             Obj.Add("HeadPhoto", DefaultPic(query.HeadPhoto)); //头像
             // Obj.Add("UserLevel", query.UserLevel); //创客实际等级
             DateTime now = DateTime.Now;