Răsfoiți Sursa

商户评论的时候 显示商户的商铺名称

lutong 1 săptămână în urmă
părinte
comite
b550b00aeb

+ 2 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/CommonCommentVo.java

@@ -24,4 +24,6 @@ public class CommonCommentVo extends CommonComment {
     private Integer commentCount;
     @ApiModelProperty(value = "评论用户手机号")
     private String headPhone;
+    @ApiModelProperty(value = "商铺名称(评论主体为商户时有效,comment_type=2)")
+    private String storeName;
 }

+ 2 - 0
alien-entity/src/main/java/shop/alien/mapper/CommonCommentMapper.java

@@ -36,9 +36,11 @@ public interface CommonCommentMapper extends BaseMapper<CommonComment> {
             "IF(cc.comment_type = 1, lu.user_image, su.head_img) AS headImg, " +
             "IF(cc.comment_type = 1, lu.user_name, su.nick_name) AS headName, " +
             "IF(cc.comment_type = 1, lu.user_phone, su.phone) AS headPhone, " +
+            "IF(cc.comment_type = 2, si.store_name, NULL) AS storeName, " +
             "IF(llr.dianzan_id IS NULL, '0', '1') AS isLike " +
             "FROM common_comment cc " +
             "LEFT JOIN life_user lu ON cc.user_id = lu.id AND lu.delete_flag = 0 " +
+            "LEFT JOIN store_info si ON cc.merchant_id = si.id AND si.delete_flag = 0 " +
             "LEFT JOIN store_user su ON cc.merchant_id = su.store_id AND su.delete_flag = 0 " +
             "AND su.id = (SELECT MIN(su2.id) FROM store_user su2 WHERE su2.store_id = cc.merchant_id AND su2.delete_flag = 0) " +
             "LEFT JOIN life_like_record llr ON llr.huifu_id = cc.id " +