Esempio n. 1
0
        /// <summary>
        /// 搜索医生
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <SearchDoctorResponseDto> SearchDoctorAsync(SearchDoctorRequestDto request)
        {
            var sqlWhere = $@"AND status='{DoctorModel.StatusEnum.Approved.ToString()}'";

            if (!string.IsNullOrWhiteSpace(request.Keyword))
            {
                sqlWhere = $"{sqlWhere} AND (hospital_name like @Keyword  OR office_name like @Keyword  OR work_city like @Keyword OR user_name like @Keyword)";
            }
            var sql = $@"
SELECT * FROM(
	SELECT
		A.*,
        CONCAT( B.base_path, B.relative_path ) AS PortraitUrl,
		C.user_name 
	FROM
		t_doctor A
		LEFT JOIN t_utility_accessory B ON B.accessory_guid = A.portrait_guid
		LEFT JOIN t_utility_user C ON C.user_guid = A.doctor_guid 
        WHERE C.ENABLE = 1 AND A.ENABLE = 1
	) t 
WHERE
	1 = 1 {sqlWhere}
ORDER BY
	creation_date"    ;

            request.Keyword = $"%{request.Keyword}%";
            return(await MySqlHelper.QueryByPageAsync <SearchDoctorRequestDto, SearchDoctorResponseDto, SearchDoctorItemDto>(sql, request));
        }
Esempio n. 2
0
        public async Task <IActionResult> SearchDoctorAsync([FromBody] SearchDoctorRequestDto request)
        {
            CommonBiz commonBiz = new CommonBiz();

            if (!string.IsNullOrEmpty(UserID))
            {
                commonBiz.SearchHistory(UserID, request.Keyword);
            }
            commonBiz.HotWordSearch(request.Keyword);
            var response = await new DoctorBiz().SearchDoctorAsync(request);

            return(Success(response));
        }
        public async Task <IActionResult> SearchDoctorAsync([FromBody] SearchDoctorRequestDto request)
        {
            var response = await new DoctorBiz().SearchDoctorAsync(request);

            return(Success(response));
        }