|
@@ -41,7 +41,7 @@ namespace GxPress.Repository.Implement.Visit
|
|
|
public async Task<PagedList<VisitResult>> GetVisitResultAsync(VisitPageSearchRequest request)
|
|
|
{
|
|
|
var resultData = new PagedList<VisitResult>();
|
|
|
- string sql = $"SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM ccpph.tede_visit a inner join ccpph.tede_user b on a.UserId=b.Id inner join ccpph.tede_department c on c.Id=b.DepartmentId where a.TypeId={request.TypeId} and a.SourceId={request.SouceId} order by a. CreatedDate desc limit {(request.Page - 1) * request.PerPage},{request.PerPage}";
|
|
|
+ string sql = $"SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM ccpph.tede_visit a inner join ccpph.tede_user b on a.UserId=b.Id left join ccpph.tede_department c on c.Id=b.DepartmentId where a.TypeId={request.TypeId} and a.SourceId={request.SouceId} order by a. CreatedDate desc limit {(request.Page - 1) * request.PerPage},{request.PerPage}";
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypestr, DatabaseType.MySql);
|
|
|
var database = new Database(databaseType, _connectionString);
|
|
|
var connection = database.GetConnection();
|
|
@@ -50,7 +50,7 @@ namespace GxPress.Repository.Implement.Visit
|
|
|
.QueryAsync<VisitResult, User, Department, VisitResult>(sql,
|
|
|
(visitResult, user, department) =>
|
|
|
{
|
|
|
- visitResult.DepartmentName = department.Name;
|
|
|
+ visitResult.DepartmentName =department!=null?department.Name:"";
|
|
|
visitResult.Name = user.Name;
|
|
|
visitResult.AvatarUrl = StringUtils.AddDomainMin(user.AvatarUrl);
|
|
|
return visitResult;
|