|
@@ -33,12 +33,14 @@
|
|
|
ch.name as orderChannel,
|
|
|
count(1) as serviceTime,
|
|
|
sum(if(a.status in (3,4),1,0)) as servicedTime,
|
|
|
- sum(if(a.status in (3,4),c.actual_price/bk.service_times,0)) as gmv
|
|
|
+ sum(if(a.status in (3,4),c.actual_price/bk.service_times,0)) as gmv,
|
|
|
+ gs.level_two as levelTwo
|
|
|
from jlife_nurse.jz_order_book_detail a
|
|
|
join jlife_nurse.jz_order_goods b on a.order_id=b.order_id
|
|
|
join jlife_nurse.jz_order c on c.id=a.order_id
|
|
|
join jlife_nurse.jz_dm_channel ch on c.order_channel=ch.id
|
|
|
join jlife_nurse.jz_order_book bk on a.book_id=bk.id
|
|
|
+ join jlife_reports.goods_stinct gs on gs.mall_goods_id=b.goods_id
|
|
|
where a.book_date between #{startTime} and #{endTime}
|
|
|
and a.status in (1,2,3,4,7)
|
|
|
and b.goods_name like '%花王%'
|