|
|
@@ -311,14 +311,14 @@ namespace SiteCore.Handler
|
|
|
returnErrorMsg("缺少必要参数");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- string sql = string.Format("SELECT tid,ctid,payment,ProductName,OrderState,Material,Craft,ProductSize,ProductCount,posCode,seller_nick,buyer_nick,buyer_id,FinishDesignTime FROM [dbo].[view_ErpTradeCell] WHERE {0}", where);
|
|
|
+ string sql = string.Format("SELECT tid,ctid,payment,ProductName,OrderState,Material,Craft,ProductSize,ShopId,ProductCount,posCode,seller_nick,buyer_nick,buyer_id,FinishDesignTime FROM [dbo].[view_ErpTradeCell] WHERE {0}", where);
|
|
|
|
|
|
DataTable dataTable = DbHelper.DbConn.ExecuteDataset(sql).Tables[0];
|
|
|
|
|
|
List<Dictionary<string, object>> list = new List<Dictionary<string, object>>();
|
|
|
if (dataTable != null && dataTable.Rows.Count > 0)
|
|
|
{
|
|
|
+ string shopCode = "";
|
|
|
Dictionary<string, object> data = new Dictionary<string, object>();
|
|
|
foreach (DataRow row in dataTable.Rows)
|
|
|
{
|
|
|
@@ -356,6 +356,22 @@ namespace SiteCore.Handler
|
|
|
data.Add("ProductCount", row["ProductCount"]);
|
|
|
data.Add("ProductName", row["ProductName"]);
|
|
|
data.Add("FinishDesignTime", row["FinishDesignTime"]);
|
|
|
+ if (string.IsNullOrEmpty(row["posCode"].ToString()) && !string.IsNullOrEmpty(shopCode))
|
|
|
+ {
|
|
|
+ data["shopCode"] = shopCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(row["ShopId"].ToString()) && string.IsNullOrEmpty(shopCode) && string.IsNullOrEmpty(row["posCode"].ToString()))
|
|
|
+ {
|
|
|
+ string shopsql = string.Format("SELECT posCode FROM [dbo].[view_ErpTradeCell] WHERE ShopId = {0} and posCode <> '' ORDER BY ID desc;", row["ShopId"]);
|
|
|
+
|
|
|
+ DataTable shopData = DbHelper.DbConn.ExecuteDataset(shopsql).Tables[0];
|
|
|
+ if (shopData != null && shopData.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ data["shopCode"] = shopData.Rows[0]["posCode"];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ shopCode = data["shopCode"].ToString();
|
|
|
list.Add(data);
|
|
|
}
|
|
|
}
|