|
@@ -284,10 +284,10 @@ namespace TEAMModelOS.Controllers
|
|
|
int count=0;
|
|
|
|
|
|
string sqlShow = "";
|
|
|
- if (roles.Count == 1 && roles.Contains("student"))
|
|
|
- {
|
|
|
- sqlShow = " and (array_contains(c.show,'student') or array_contains(c.show,'all')) ";
|
|
|
- }
|
|
|
+ //if (roles.Count == 1 && roles.Contains("student"))
|
|
|
+ //{
|
|
|
+ // sqlShow = " and (array_contains(c.show,'student') or array_contains(c.show,'all')) ";
|
|
|
+ //}
|
|
|
cosmosDbQuery.QueryText = cosmosDbQuery.QueryText.Replace("where", $" where (c.status<>404 or IS_DEFINED(c.status) = false ) {sqlShow} and ");
|
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).GetItemQueryIterator<int>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
|
|
|
{
|
|
@@ -433,9 +433,9 @@ namespace TEAMModelOS.Controllers
|
|
|
try
|
|
|
{
|
|
|
string sqlShow = "";
|
|
|
- if (roles.Count == 1 && roles.Contains("student") ) {
|
|
|
- sqlShow = " and (array_contains(c.show,'student') or array_contains(c.show,'all')) ";
|
|
|
- }
|
|
|
+ //if (roles.Count == 1 && roles.Contains("student") ) {
|
|
|
+ // sqlShow = " and (array_contains(c.show,'student') or array_contains(c.show,'all')) ";
|
|
|
+ //}
|
|
|
cosmosDbQuery.QueryText = cosmosDbQuery.QueryText.Replace("where", $" where (c.status<>404 or IS_DEFINED(c.status) = false ) {sqlShow} and ");
|
|
|
await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname)
|
|
|
.GetItemQueryStreamIterator(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, continuationToken: continuationToken,
|