api endpoint returns actives parents by default
This commit is contained in:
@@ -27,9 +27,22 @@ if (!$allowKey || !$allowKey->isValidFor('api')) {
|
||||
die(json_encode(['success' => false]));
|
||||
}
|
||||
|
||||
$wkSqlQuery = 'SELECT * FROM `wettkampfkalender` WHERE `Datum` >= CURDATE();';
|
||||
$wkSqlQuery = "SELECT DISTINCT"
|
||||
." `wkParticipo_Users`.* "
|
||||
." FROM `wkParticipo_Users`"
|
||||
." JOIN `vormundschaft`"
|
||||
." ON `wkParticipo_Users`.`id` =`vormundschaft`.`userId`"
|
||||
." JOIN `wkParticipo_user<=>userAttributes`"
|
||||
." ON `wkParticipo_user<=>userAttributes`.`userId` = `vormundschaft`.`kidId`"
|
||||
." WHERE `wkParticipo_user<=>userAttributes`.`attributeId` = 4"
|
||||
." ORDER BY `wkParticipo_Users`.`id` ASC;";
|
||||
|
||||
$wkSqlResponse = dbConnector::query($wkSqlQuery);
|
||||
|
||||
foreach( $wkSqlResponse as &$user){
|
||||
$user['eMail'] = explode(",", $user['eMail']);
|
||||
}
|
||||
|
||||
header('Access-Control-Allow-Headers: *');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
|
||||
5
homepage/participo/testApi.py
Normal file → Executable file
5
homepage/participo/testApi.py
Normal file → Executable file
@@ -1,3 +1,5 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
from http import client
|
||||
import logging
|
||||
import json
|
||||
@@ -27,7 +29,6 @@ try:
|
||||
print(json.dumps(json.loads(body),indent=2))
|
||||
except:
|
||||
print(f"failed to parse to json")
|
||||
print(body
|
||||
)
|
||||
print(body)
|
||||
|
||||
connection.close()
|
||||
|
||||
@@ -13,7 +13,6 @@ $db = dbConnector::connect(
|
||||
$cwsvJudoConfig['db']['user'],
|
||||
$cwsvJudoConfig['db']['password']
|
||||
);
|
||||
// echo($db);
|
||||
|
||||
$wkSqlQuery = 'SELECT * FROM `wettkampfkalender` WHERE `Datum` >= CURDATE();';
|
||||
$wkSqlResponse = dbConnector::query($wkSqlQuery);
|
||||
|
||||
Reference in New Issue
Block a user