|
|
@@ -7,6 +7,7 @@ using System.Web;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
using System.Linq;
|
|
|
+using System.Data;
|
|
|
using System.Threading.Tasks;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
@@ -115,7 +116,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//商品名称
|
|
|
if (!string.IsNullOrEmpty(ProductIdSelect))
|
|
|
{
|
|
|
- condition += " and ProductId=" + ProductIdSelect;
|
|
|
+ condition += " and Id in (select OrderId from OrderProduct where ProductId="+ProductIdSelect+")";//表数据量过大时不适用
|
|
|
}
|
|
|
//仓库类型
|
|
|
if (!string.IsNullOrEmpty(StoreTypeSelect))
|
|
|
@@ -194,6 +195,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
//商品名称
|
|
|
dic["ProductId"] = RelationClass.GetProductsInfo(int.Parse(dic["ProductId"].ToString()));
|
|
|
+
|
|
|
+ //商品名称
|
|
|
+ int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
|
|
|
+ OrderProduct orderProducts = db.OrderProduct.FirstOrDefault(m => m.OrderId == Id) ?? new OrderProduct();
|
|
|
+ dic["ProductName"] = orderProducts.ProductName;
|
|
|
+
|
|
|
//仓库归属创客
|
|
|
int StoreUserId = int.Parse(function.CheckInt(dic["StoreUserId"].ToString()));
|
|
|
Users storeuserid_Users = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
|
|
|
@@ -214,12 +221,99 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
}
|
|
|
Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
- other.Add("SuccessAmount", 0);
|
|
|
- other.Add("FailAmount", 0);
|
|
|
+ string SuccessAmount = "0.00";//支付成功总金额
|
|
|
+ string FailAmount = "0.00";//支付失败总金额
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=0" + condition);
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
+ }
|
|
|
+ dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=1" + condition);
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
|
|
|
+ }
|
|
|
+ other.Add("SuccessAmount", SuccessAmount);
|
|
|
+ other.Add("FailAmount", FailAmount);
|
|
|
obj.Add("other", other);
|
|
|
return Json(obj);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public JsonResult IndexDatas(string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, int page = 1, int limit = 30)
|
|
|
+ {
|
|
|
+ string condition = " and Status>-1";
|
|
|
+ //创客创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //支付方式
|
|
|
+ if (!string.IsNullOrEmpty(PayModeSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayMode=" + PayModeSelect;
|
|
|
+ }
|
|
|
+ //仓库仓库编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdStoreNo))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
|
|
|
+ }
|
|
|
+ //仓库仓库名称
|
|
|
+ if (!string.IsNullOrEmpty(StoreIdStoreName))
|
|
|
+ {
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
|
|
|
+ }
|
|
|
+ //退款状态
|
|
|
+ if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and RefundStatus=" + RefundStatusSelect;
|
|
|
+ }
|
|
|
+ //提货类型
|
|
|
+ if (!string.IsNullOrEmpty(DeliveryTypeSelect))
|
|
|
+ {
|
|
|
+ condition += " and DeliveryType=" + DeliveryTypeSelect;
|
|
|
+ }
|
|
|
+ //发货状态
|
|
|
+ if (!string.IsNullOrEmpty(SendStatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and SendStatus=" + SendStatusSelect;
|
|
|
+ }
|
|
|
+ //商品名称
|
|
|
+ if (!string.IsNullOrEmpty(ProductIdSelect))
|
|
|
+ {
|
|
|
+ condition += " and ProductId=" + ProductIdSelect;
|
|
|
+ }
|
|
|
+ //仓库类型
|
|
|
+ if (!string.IsNullOrEmpty(StoreTypeSelect))
|
|
|
+ {
|
|
|
+ condition += " and StoreType=" + StoreTypeSelect;
|
|
|
+ }
|
|
|
+ //仓库归属创客创客编号
|
|
|
+ if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ //仓库归属创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(StoreUserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and StoreUserId in (select StoreUserId from UserForRealName where RealName='" + StoreUserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //支付状态
|
|
|
+ if (!string.IsNullOrEmpty(PayStatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayStatus=" + PayStatusSelect;
|
|
|
+ }
|
|
|
+ List<Dictionary<string, object>> other = new List<Dictionary<string, object>>();
|
|
|
+ Dictionary<string, object> obj = new Dictionary<string, object>();
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=0" + condition);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 增加创客订单
|