public async Task <IActionResult> GetRecommendProductListAsync([FromBody] GetRecommendProductListRequestDto request)
        {
            var response = await new RecommendBiz().GetRecommendProductListAsync(request);

            return(Success(response));
        }
Exemple #2
0
        /// <summary>
        /// 获取商品推荐列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <GetRecommendProductListResponseDto> GetRecommendProductListAsync(GetRecommendProductListRequestDto request)
        {
            var sqlWhere = $@" 1=1 AND A.type = '{RecommendModel.TypeEnum.Product.ToString()}' AND A.ENABLE = 1";

            if (!string.IsNullOrWhiteSpace(request.RecommendGuid))
            {
                sqlWhere = $"{sqlWhere} AND A.recommend_guid=@RecommendGuid";
            }
            var sql    = $@"
SELECT
	A.type,
	A.recommend_guid,
	B.owner_guid,
	B.detail_guid,
	C.*,
	CONCAT( D.base_path, D.relative_path ) AS PictureUrl 
FROM
	t_manager_recommend A
	INNER JOIN t_manager_recommend_detail B ON A.recommend_guid = B.recommend_guid
	INNER JOIN t_mall_product C ON B.owner_guid = C.product_guid and C.`enable`=1
	LEFT JOIN t_utility_accessory D ON D.accessory_guid = C.picture_guid
WHERE
	{sqlWhere}
ORDER BY
	C.creation_date "    ;
            var result = await MySqlHelper.QueryByPageAsync <GetRecommendProductListRequestDto, GetRecommendProductListResponseDto, GetRecommendProductListItemDto>(sql, request);

            return(result);
        }
        public async Task <IActionResult> GetRecommendProductAsync(GetRecommendProductListRequestDto requestDto)
        {
            var result = await new ProductBiz().GetRecommendProductListAsync(requestDto);

            return(Success(result));
        }