%@ Control Language="C#" AutoEventWireup="true" Inherits="AVA.ResourcesPlatform.WebUI.Control.My.MyComparison" %>
<%= new MyGrowthPathNavTopInstance(this) { Local= MyGrowthPathNavTopItem.比一比 }.ToHtml()%>
<%
var userGuid = Request.QueryString["UserGuid"];
var listTeacher = CreateInstance.UserDao.Where(l => l.ParentUserType.TeacherEbable == true
&& l.Status == (int)AVA.ResourcesPlatform.Model.Pub.UserStatusEnum.有效
&& l.Verify == (int)AVA.ResourcesPlatform.Model.Pub.UserVerifyEnum.已验证
&& l.ParentDomain == this.User.ParentDomain
&& l.Guid != CookieGroup.UserCode)
.ToList();
%>
<%
if (!string.IsNullOrEmpty(userGuid))
{
var otherUser = CreateInstance.UserDao.Get(userGuid);
//var transformer = new Z.Core.NHibernateCore.TupleToPropertyResultTransformer
// ("TeacherRatio", "StudentRatio", "TransferRatio");
var critThis = CreateInstance.VideoDao.NHibernateSession.CreateCriteria("_Alias");
critThis.Add(NHibernate.Criterion.Expression.Eq("Examine", (int)AVA.ResourcesPlatform.Model.Pub.VideoExamineEnum.审核通过));
critThis.Add(NHibernate.Criterion.Expression.Eq("Status", (int)AVA.ResourcesPlatform.Model.Pub.VideoStatusEnum.有效));
critThis.CreateAlias("ParentUser", "_User");
critThis.Add(NHibernate.Criterion.Expression.Eq("_User.Guid", this.User.Guid));
critThis.Add(NHibernate.Criterion.Expression.Ge("TeacherRatio", 0));
critThis.Add(NHibernate.Criterion.Expression.Ge("StudentRatio", 0));
critThis.Add(NHibernate.Criterion.Expression.Ge("TransferRatio", 0));
critThis.SetProjection(NHibernate.Criterion.Projections.ProjectionList()
.Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TeacherRatio"))
.Add(NHibernate.Criterion.Projections.AvgDefaultDataType("StudentRatio"))
.Add(NHibernate.Criterion.Projections.AvgDefaultDataType("TransferRatio"))
);
var thisVideo = critThis.List