mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
update sql files from christine to remove warnings by running skeema
This commit is contained in:
commit
10c92fd464
8
skeema/gradido_community/community_profiles.sql
Normal file
8
skeema/gradido_community/community_profiles.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE `community_profiles` (
|
||||
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`state_user_id` INT UNSIGNED NOT NULL,
|
||||
`profile_img` LONGBLOB NULL,
|
||||
`profile_desc` VARCHAR(2000) NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
FOREIGN KEY (`state_user_id`) REFERENCES `state_users`(`id`)
|
||||
) ENGINE=InnoDB;
|
||||
@ -7,6 +7,7 @@ CREATE TABLE `state_users` (
|
||||
`first_name` varchar(255) DEFAULT NULL,
|
||||
`last_name` varchar(255) DEFAULT NULL,
|
||||
`username` varchar(255) DEFAULT NULL,
|
||||
`disabled` tinyint DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `public_key` (`public_key`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
@ -199,12 +199,15 @@ class AppController extends Controller
|
||||
if ($stateUserQuery->count() == 1) {
|
||||
$stateUser = $stateUserQuery->first();
|
||||
if ($stateUser->first_name != $json['user']['first_name'] ||
|
||||
$stateUser->last_name != $json['user']['last_name'] ||
|
||||
//$stateUser->username != $json['user']['username'] ||
|
||||
// -> throws error
|
||||
$stateUser->email != $json['user']['email']) {
|
||||
$stateUser->last_name != $json['user']['last_name'] ||
|
||||
$stateUser->disabled != $json['user']['disabled'] ||
|
||||
//$stateUser->username != $json['user']['username'] ||
|
||||
// -> throws error
|
||||
$stateUser->email != $json['user']['email']
|
||||
) {
|
||||
$stateUser->first_name = $json['user']['first_name'];
|
||||
$stateUser->last_name = $json['user']['last_name'];
|
||||
$stateUser->disabled = $json['user']['disabled'];
|
||||
//$stateUser->username = $json['user']['username'];
|
||||
$stateUser->email = $json['user']['email'];
|
||||
if (!$stateUserTable->save($stateUser)) {
|
||||
@ -222,6 +225,7 @@ class AppController extends Controller
|
||||
$newStateUser->public_key = $public_key_bin;
|
||||
$newStateUser->first_name = $json['user']['first_name'];
|
||||
$newStateUser->last_name = $json['user']['last_name'];
|
||||
$newStateUser->disabled = $json['user']['disabled'];
|
||||
//$newStateUser->username = $json['user']['username'];
|
||||
$newStateUser->email = $json['user']['email'];
|
||||
if (!$stateUserTable->save($newStateUser)) {
|
||||
|
||||
@ -242,11 +242,17 @@ class TransactionCreationsController extends AppController
|
||||
->find('all')
|
||||
->select(['id', 'first_name', 'last_name', 'email'])
|
||||
->order(['first_name', 'last_name'])
|
||||
->where(['OR' => [
|
||||
'LOWER(first_name)' => strtolower($requestData['searchText']),
|
||||
'LOWER(last_name)' => strtolower($requestData['searchText']),
|
||||
'LOWER(email)' => strtolower($requestData['searchText'])
|
||||
]])
|
||||
->where(
|
||||
['AND' => [
|
||||
'disabled' => 0,
|
||||
'OR' => [
|
||||
'LOWER(first_name)' => strtolower($requestData['searchText']),
|
||||
'LOWER(last_name)' => strtolower($requestData['searchText']),
|
||||
'LOWER(email)' => strtolower($requestData['searchText'])
|
||||
]
|
||||
]
|
||||
]
|
||||
)
|
||||
->contain(['TransactionCreations' => [
|
||||
'fields' => [
|
||||
'TransactionCreations.amount',
|
||||
|
||||
@ -36,6 +36,7 @@ class StateUser extends Entity
|
||||
'email' => true,
|
||||
'first_name' => true,
|
||||
'last_name' => true,
|
||||
'disabled' => true,
|
||||
'username' => true,
|
||||
'index' => true,
|
||||
'state_group' => true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user