|
@@ -67,7 +67,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
Dictionary<string, TmidStics> tmidDic = new();
|
|
|
|
|
|
QueryDefinition query =
|
|
|
- new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail FROM c WHERE (ARRAY_CONTAINS(@key, c.id))")
|
|
|
+ new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
.WithParameter("@key", tmids);
|
|
|
await foreach (var item in cosmosClientCsv2
|
|
|
.GetContainer("Core", "ID2")
|
|
@@ -79,6 +79,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
foreach (var doc in json.RootElement.GetProperty("Documents").EnumerateArray())
|
|
|
{
|
|
|
string id = doc.GetProperty("id").GetString();
|
|
|
+ if(!tmids.Contains(id)) tmids.Add(id);
|
|
|
//基本資料
|
|
|
TmidStics tmidStics = (tmidDic.ContainsKey(id)) ? tmidDic[id] : new() { id = id };
|
|
|
string tmidName = doc.GetProperty("name").GetString();
|
|
@@ -112,9 +113,9 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
|
|
|
//積分
|
|
|
var usersPoints = tablePointsClient.Get("Points", id);
|
|
|
- tmidStics.points.points = usersPoints.Properties["Points"].Int32Value.Value;
|
|
|
- tmidStics.points.level = usersPoints.Properties["Level"].Int32Value.Value;
|
|
|
- tmidStics.points.balance = usersPoints.Properties["Balance"].Int32Value.Value;
|
|
|
+ tmidStics.points.points = (usersPoints != null) ? usersPoints.Properties["Points"].Int32Value.Value : 0;
|
|
|
+ tmidStics.points.level = (usersPoints != null) ? usersPoints.Properties["Level"].Int32Value.Value : 0;
|
|
|
+ tmidStics.points.balance = (usersPoints != null) ? usersPoints.Properties["Balance"].Int32Value.Value : 0;
|
|
|
//個人服務授權
|
|
|
tmidStics.prod = await getTMIDAuthService(cosmosClientCsv2, id, "", true);
|
|
|
|
|
@@ -124,7 +125,7 @@ namespace TEAMModelBI.Controllers.BITmid
|
|
|
}
|
|
|
|
|
|
//ID進階資料
|
|
|
- QueryDefinition queryex = new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail, c.country, c.province, c.city, c.schoolCode, c.schoolCodeW FROM c WHERE (ARRAY_CONTAINS(@key, c.id))")
|
|
|
+ QueryDefinition queryex = new QueryDefinition(@"SELECT c.id, c.name, c.mobile, c.mail, c.country, c.province, c.city, c.schoolCode, c.schoolCodeW FROM c WHERE (ARRAY_CONTAINS(@key, c.id) OR ARRAY_CONTAINS(@key, c.mobile))")
|
|
|
.WithParameter("@key", tmids);
|
|
|
await foreach (var item in cosmosClientCsv2
|
|
|
.GetContainer("Core", "ID2")
|