Commit 5249ce4c by 泽锋 李

fix

parent bc8af3b6
...@@ -34,13 +34,19 @@ where 1=1 "; ...@@ -34,13 +34,19 @@ where 1=1 ";
DynamicParameters parameters = new DynamicParameters(); DynamicParameters parameters = new DynamicParameters();
if (search != null) if (search != null)
{ {
if (search.start_date != null) if(search.start_date!=null && search.end_date != null)
{ {
sql += " and t1.push_time>=@start_date "; sql += " and EXISTS (select * from dc_base_stock_record as t_re where tv.bailun_sku = t_re.bailun_sku and t_re.stock_time>=@start_date and t_re.stock_time<=@end_date and has_transfer=1 ) ";
parameters.Add("start_date", search.start_date.Value.ToString("yyyy-MM-dd 00:00:00")); parameters.Add("start_date", search.start_date.Value.ToString("yyyy-MM-dd 00:00:00"));
}if (search.end_date != null) parameters.Add("end_date", search.start_date.Value.ToString("yyyy-MM-dd 23:59:59"));
}
else if (search.start_date != null)
{
sql += " and EXISTS (select * from dc_base_stock_record as t_re where tv.bailun_sku = t_re.bailun_sku and t_re.stock_time>=@start_date and has_transfer=1 ) ";
parameters.Add("start_date", search.start_date.Value.ToString("yyyy-MM-dd 00:00:00"));
}else if (search.end_date != null)
{ {
sql += " and t1.push_time<=@end_date "; sql += " and EXISTS (select * from dc_base_stock_record as t_re where tv.bailun_sku = t_re.bailun_sku and t_re.stock_time<=@end_date and has_transfer=1 ) ";
parameters.Add("end_date", search.start_date.Value.ToString("yyyy-MM-dd 23:59:59")); parameters.Add("end_date", search.start_date.Value.ToString("yyyy-MM-dd 23:59:59"));
} }
if (search.bailun_sku != null) if (search.bailun_sku != null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment