vardatas=_connection.Query<dc_report_purchase_week>(" select * from dc_report_purchase_week where first_day_date>=@btime and first_day_date <=@etime ",new{btime,etime});
@@ -3208,7 +3330,7 @@ where t1.bailun_sku = t2.bailun_sku and t1.week_tag=@week_tag;
...
@@ -3208,7 +3330,7 @@ where t1.bailun_sku = t2.bailun_sku and t1.week_tag=@week_tag;
delete from dc_report_purchase_week where week_tag=@week_tag;
delete from dc_report_purchase_week where week_tag=@week_tag;
insert into dc_report_purchase_week(`week_tag`,`type`,`warehouse_code`,`bailun_sku`,`stock`,`unit_price`,`is_new`,`quantity_purchase`,`amount_paid`,`web_stie`,`first_day_date`)
insert into dc_report_purchase_week(`week_tag`,`type`,`warehouse_code`,`bailun_sku`,`stock`,`unit_price`,`is_new`,`quantity_purchase`,`amount_paid`,`web_site`,`first_day_date`)
(
(
select
select
@week_tag as 'week_tag',
@week_tag as 'week_tag',
...
@@ -3225,7 +3347,7 @@ case
...
@@ -3225,7 +3347,7 @@ case
) as 'is_new',
) as 'is_new',
sum(t_ps.deliverycount) as 'quantity_purchase',
sum(t_ps.deliverycount) as 'quantity_purchase',
sum(t_ps.deliverycount * t3.unit_price) as 'amount_paid',
sum(t_ps.deliverycount * t3.unit_price) as 'amount_paid',
t2.area_name as 'web_stie',
t2.area_name as 'web_site',
@btime as 'first_day_date'
@btime as 'first_day_date'
from dc_base_transfer_info as t_p
from dc_base_transfer_info as t_p
left join dc_base_transfer_info_skus as t_ps on t_p.`dataid` = t_ps.dataid
left join dc_base_transfer_info_skus as t_ps on t_p.`dataid` = t_ps.dataid
...
@@ -3238,7 +3360,7 @@ GROUP BY t_ps.sku ,t_p.targetwareno
...
@@ -3238,7 +3360,7 @@ GROUP BY t_ps.sku ,t_p.targetwareno
);
);
insert into dc_report_purchase_week(`week_tag`,`type`,`warehouse_code`,`bailun_sku`,`stock`,`unit_price`,`is_new`,`quantity_purchase`,`amount_paid`,`web_stie`,`first_day_date`)
insert into dc_report_purchase_week(`week_tag`,`type`,`warehouse_code`,`bailun_sku`,`stock`,`unit_price`,`is_new`,`quantity_purchase`,`amount_paid`,`web_site`,`first_day_date`)
(
(
select
select
@week_tag as 'week_tag',
@week_tag as 'week_tag',
...
@@ -3255,7 +3377,7 @@ case
...
@@ -3255,7 +3377,7 @@ case
) as 'is_new',
) as 'is_new',
sum(t_p.quantity_purchase) as 'quantity_purchase',
sum(t_p.quantity_purchase) as 'quantity_purchase',
sum(t_p.amount_paid) as 'amount_paid',
sum(t_p.amount_paid) as 'amount_paid',
t2.area_name as 'web_stie',
t2.area_name as 'web_site',
@btime as 'first_day_date'
@btime as 'first_day_date'
from dc_base_purchase_details as t_p
from dc_base_purchase_details as t_p
left join dc_base_stock as t1 on t1.bailun_sku =t_p.bailun_sku and t1.warehouse_code = t_p.warehouse_into_code
left join dc_base_stock as t1 on t1.bailun_sku =t_p.bailun_sku and t1.warehouse_code = t_p.warehouse_into_code