where+=$@" and g.{nameof(RB_Goods_Extend.IsSpell)}={dmodel.IsSpell}";
where+=$@" and g.{nameof(RB_Goods_Extend.IsSpell)}={dmodel.IsSpell}";
}
}
...
@@ -1314,7 +1461,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
...
@@ -1314,7 +1461,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
{
{
where+=$@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
where+=$@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
}
if(!string.IsNullOrEmpty(dmodel.GoodsIds))
if(!string.IsNullOrEmpty(dmodel.GoodsIds))
{
{
where+=$@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
where+=$@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
...
@@ -1331,7 +1478,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
...
@@ -1331,7 +1478,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
{
{
where+=$@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
where+=$@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
}
if(dmodel.IsProcurement>0)
if(dmodel.IsProcurement>0)
{
{
where+=$@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
where+=$@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
...
@@ -1349,7 +1496,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
...
@@ -1349,7 +1496,7 @@ where {where} GROUP BY g.Id asc order by {orderBy} ,b.date asc";
where+=$@" and b.{nameof(RB_Goods_Extend.TeacherId)}={dmodel.TeacherId}";
where+=$@" and b.{nameof(RB_Goods_Extend.TeacherId)}={dmodel.TeacherId}";
}
}
stringorderBy=" g.Sort desc";
stringorderBy=" g.Sort desc";
stringsql=$@" SELECT g.*,c.CourseNum from rb_goods as g
stringsql=$@" SELECT g.*,c.CourseNum from rb_goods as g
LEFT JOIN rb_goods_wk_teacher as b on g.Id=b.GoodsId
LEFT JOIN rb_goods_wk_teacher as b on g.Id=b.GoodsId
LEFT JOIN (SELECT GoodsId,COUNT(*) as CourseNum from rb_goods_wk_course where `Status`=0 GROUP BY GoodsId) as c on c.GoodsId=g.Id where {where} order by {orderBy}";
LEFT JOIN (SELECT GoodsId,COUNT(*) as CourseNum from rb_goods_wk_course where `Status`=0 GROUP BY GoodsId) as c on c.GoodsId=g.Id where {where} order by {orderBy}";