@@ -2405,6 +2405,49 @@ order by t1.gmt_modified asc
publicDateTime?estimated_arrival_time{get;set;}
publicDateTimecreate_time{get;set;}
}
/// <summary>
/// 刷新最近7天的订单总数
/// </summary>
publicstaticvoidResetOrders7()
{
// 清空数据先
_connection.Execute(" update dc_base_stock set orders_7=0 where orders_7>0 ",commandTimeout:0);
varorderCounts=_connection.Query<reset_orders_7_dto>($@"select bailun_sku,warehouse_code,count(1) as 'orders_7' from dc_base_oms_sku_30 where
has_fba_s = 0
and has_delete = 0
and has_scalp = 0
and has_buyer_remark = 0
and has_platsku_remark = 0
and has_innersale = 0
and bailun_order_status !='Canceled'
and platform_order_type != '手工单'
and pay_time>=@btime and pay_time<=@etime and warehouse_code='GZBLWH' GROUP BY bailun_sku,warehouse_code",new{
btime=DateTime.Now.AddDays(-8).ToDayHome(),
etime=DateTime.Now.AddDays(-1).ToDayEnd(),
},commandTimeout:0);
// 写入
foreach(variteminorderCounts)
{
_connection.Execute(" update dc_base_stock set orders_7=@orders_7,orders_7_reset_date=now() where bailun_sku=@bailun_sku and warehouse_code=@warehouse_code ",new{