|
|
@@ -1290,13 +1290,13 @@ select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitU
|
|
|
ifnull(c.count,0) as countInterest,b.expert,ifnull(x.a,0) as favorable,ifnull(x.b,0) as general,
|
|
|
ifnull(x.c,0) as inferior,ifnull(x.d,0) as commentCount,ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate,
|
|
|
if(isnull(d.to_uid),0,1) as interested
|
|
|
- from `user` a left join user_identity b on a.id=b.uid left join (select b.seller_id as uid,
|
|
|
+ from `user` a left join user_identity b on a.id=b.uid left join (select a.commodity_id as uid,
|
|
|
sum(case when a.star > 3 then 1 else 0 end) as a,
|
|
|
sum(case when a.star=3 then 1 else 0 end) as b,
|
|
|
sum(case when a.star < 3 then 1 else 0 end) as c,count(*) as d
|
|
|
from jt_commodity_comment a
|
|
|
left join jt_consult_order b on a.order_no=b.order_no
|
|
|
- group by b.seller_id)x on a.id=x.uid
|
|
|
+ group by a.commodity_id)x on a.id=x.uid
|
|
|
left join (select count(*) as count,to_uid from user_interest group by to_uid)c on a.id=c.to_uid
|
|
|
left join (select to_uid from user_interest where from_uid= #{uid,jdbcType=VARCHAR} group by to_uid)d on a.id=d.to_uid
|
|
|
where a.id=#{id,jdbcType=VARCHAR}
|
|
|
@@ -1309,13 +1309,13 @@ where a.id=#{id,jdbcType=VARCHAR}
|
|
|
ifnull( x.d, 0 ) as commentCount, ifnull( cast(x.a*100 / x.d as decimal(18, 2)), 100 ) as favorableRate
|
|
|
from
|
|
|
`user` u left join user_identity ui on ui.uid = u.id
|
|
|
- left join(select b.seller_id as uid,
|
|
|
+ left join(select a.commodity_id as uid,
|
|
|
sum(case when a.star > 3 then 1 else 0 end) as a,
|
|
|
sum(case when a.star=3 then 1 else 0 end) as b,
|
|
|
sum(case when a.star < 3 then 1 else 0 end) as c,count(*) as d
|
|
|
from jt_commodity_comment a
|
|
|
left join jt_consult_order b on a.order_no=b.order_no
|
|
|
- group by b.seller_id)x on u.id=x.uid
|
|
|
+ group by a.commodity_id)x on u.id=x.uid
|
|
|
left join( select count(*) as count, to_uid from user_interest group by to_uid) a
|
|
|
on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} ) b
|
|
|
on u.id = b.to_uid
|
|
|
@@ -1445,9 +1445,9 @@ select a.create_time as createTime,
|
|
|
a.content,a.star,u.identify_name as commenter
|
|
|
from jt_commodity_comment a
|
|
|
left join user u on a.uid=u.id
|
|
|
- left join jt_consult_order b on a.order_no=b.order_no
|
|
|
+ <!-- left join jt_consult_order b on a.order_no=b.order_no -->
|
|
|
where 1=1
|
|
|
- and b.seller_id= #{id,jdbcType=VARCHAR}
|
|
|
+ and a.commodity_id= #{id,jdbcType=VARCHAR}
|
|
|
order by a.star desc,a.create_time desc
|
|
|
limit 1
|
|
|
|