|
@@ -143,15 +143,18 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
|
|
|
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 IsActNum = query.Count(m => m.IsAct == 1);
|
|
|
- int UnActNum = query.Count(m => m.IsAct == 0);
|
|
|
if (!string.IsNullOrEmpty(SearchKey))
|
|
|
{
|
|
|
query = query.Where(m => m.Name.Contains(SearchKey));
|
|
|
}
|
|
|
if (Kind > 0)
|
|
|
{
|
|
|
- query = query.Where(m => m.BindStatus == Kind);
|
|
|
+ string subjectType = "";
|
|
|
+ if (Kind == 1) subjectType = "SUBJECT_TYPE_INDIVIDUAL";
|
|
|
+ if (Kind == 2) subjectType = "SUBJECT_TYPE_ENTERPRISE";
|
|
|
+ if (Kind == 3) subjectType = "SUBJECT_TYPE_SMALL";
|
|
|
+ List<int> ids = maindb.MerchantAddInfo.Where(m => m.SubjectType == subjectType).ToList().Select(m => m.Id).ToList();
|
|
|
+ query = query.Where(m => ids.Contains(m.Id));
|
|
|
}
|
|
|
if (ActiveStatus > 0)
|
|
|
{
|
|
@@ -159,17 +162,17 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
query = query.Where(m => m.ActivationStatus == ActiveStatus);
|
|
|
}
|
|
|
int TotalCount = query.Count();
|
|
|
+ int IsActNum = query.Count(m => m.IsAct == 1);
|
|
|
+ int ProductCount = query.Count();
|
|
|
if (IsAct > 0)
|
|
|
{
|
|
|
- IsActNum = query.Count(m => m.IsAct == 1);
|
|
|
- UnActNum = query.Count(m => m.IsAct == 0);
|
|
|
if (IsAct == 2) IsAct = 0;
|
|
|
query = query.Where(m => m.IsAct == IsAct);
|
|
|
}
|
|
|
int ActCount = query.Count(m => m.ActivationDate == today);
|
|
|
- int ProductCount = query.Count();
|
|
|
int ProductActCount = query.Count(m => m.ActivationStatus == 1);
|
|
|
int ProductUnActCount = ProductCount - ProductActCount;
|
|
|
+ int UnActNum = ProductCount - IsActNum;
|
|
|
if (TradeSort == "1")
|
|
|
{
|
|
|
if (DateSort == "1")
|
|
@@ -252,7 +255,7 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
Obj.Add("IsAct", merchant.IsAct); //是否激活(0 否 1 是)
|
|
|
if (merchant.IsAct == 1)
|
|
|
{
|
|
|
- var orderInfo = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status == 1 && m.MerchantId == Id) ?? new MerchantDepositOrder();
|
|
|
+ var orderInfo = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status > 0 && m.MerchantId == Id) ?? new MerchantDepositOrder();
|
|
|
var IsPay = 0;
|
|
|
if (orderInfo.Id > 0)
|
|
|
{
|