コード例 #1
0
        /// <summary>
        /// 获取问答最新问题分页列表
        /// </summary>
        /// <param name="requestDto"></param>
        /// <returns></returns>
        public async Task <GetLatestFAQsPageListResponseDto> GetLatestFAQsPageListAsync(GetLatestFAQsPageListRequestDto requestDto)
        {
            var wheresql = string.Empty;

            if (!string.IsNullOrWhiteSpace(requestDto.Keyword))
            {
                wheresql           = "and a.content like @Keyword ";
                requestDto.Keyword = $"%{requestDto.Keyword}%";
            }
            var sql    = $@"SELECT
	                        a.question_guid,
	                        a.content,
	                        a.creation_date,
	                        a.answer_num,
	                        a.`status`,
	                        ifnull( b.visit_count, 0 ) AS visit_count 
                        FROM
	                        t_faqs_question a
	                        LEFT JOIN t_utility_hot b ON a.question_guid = b.owner_guid 
                        WHERE a.`enable`=1 {wheresql}
                        ORDER BY
	                        a.creation_date DESC"    ;
            var result = await MySqlHelper.QueryByPageAsync <GetLatestFAQsPageListRequestDto, GetLatestFAQsPageListResponseDto, GetLatestFAQsPageListItemDto>(sql, requestDto);

            return(result);
        }
コード例 #2
0
        public async Task <IActionResult> GetLatestFAQsPageListAsync([FromQuery] GetLatestFAQsPageListRequestDto requestDto)
        {
            var response = await new FaqsQuestionBiz().GetLatestFAQsPageListAsync(requestDto);

            return(Success(response));
        }