visible parameter for persons and badges
This commit is contained in:
parent
b5bf9246b2
commit
ef1e69e773
@ -28,6 +28,6 @@ class SELECT_PERSONS extends \SYSTEM\DB\QQ {
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `persons` ORDER BY `order`';
|
||||
'SELECT * FROM `persons` WHERE `visible` = 1 ORDER BY `order`';
|
||||
}
|
||||
}
|
||||
@ -28,6 +28,6 @@ class SELECT_PERSON_BADGES extends \SYSTEM\DB\QQ {
|
||||
* @return string Returns MYSQL Query String
|
||||
*/
|
||||
public static function mysql(){return
|
||||
'SELECT * FROM `person_badges`';
|
||||
'SELECT * FROM `person_badges` WHERE `visible` = 1 ORDER BY `order`';
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,8 @@ CREATE TABLE `person_badges` (
|
||||
`person` INT(10) UNSIGNED NOT NULL,
|
||||
`badge` VARCHAR(20) NOT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`color` VARCHAR(20) NOT NULL DEFAULT 'badge-primary' COLLATE 'utf8mb4_unicode_ci',
|
||||
`order` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
`order` INT(10) UNSIGNED NOT NULL,
|
||||
`visible` INT(10) UNSIGNED NULL DEFAULT 1,
|
||||
PRIMARY KEY (`person`, `badge`),
|
||||
INDEX `person` (`person`),
|
||||
CONSTRAINT `FK__persons` FOREIGN KEY (`person`) REFERENCES `persons` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
|
||||
|
||||
@ -3,10 +3,12 @@ CREATE TABLE `persons` (
|
||||
`name` VARCHAR(50) NOT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`img` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`info` TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_unicode_ci',
|
||||
`order` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||
`order` INT(10) UNSIGNED NOT NULL,
|
||||
`visible` INT(10) UNSIGNED NULL DEFAULT 1,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `id` (`id`)
|
||||
)
|
||||
COLLATE='utf8mb4_unicode_ci'
|
||||
ENGINE=InnoDB
|
||||
AUTO_INCREMENT=1
|
||||
;
|
||||
Loading…
x
Reference in New Issue
Block a user