fix user bugs

This commit is contained in:
Tóth Richárd
2018-12-11 19:52:43 +01:00
parent 7a24fdee51
commit ddd2727ef2
2 changed files with 141 additions and 141 deletions

View File

@@ -132,7 +132,7 @@ class user {
public function get_training_count_in_month($_year, $_month) { public function get_training_count_in_month($_year, $_month) {
global $sql; global $sql;
return $sql->single_variable('select count(distinct trc_id) from training_coach join training on tr_id = trc_training_tr_id where year(tr_date) = '.$_year.' and month(tr_date) = '.$_month.' and trc_coach_uc_id = '.$this->get_ua_id().';'); return $sql->single_variable('select count(distinct trc_id) from training_coach join training on tr_id = trc_training_tr_id where year(tr_date) = '.$_year.' and month(tr_date) = '.$_month.' and trc_coach_uc_id = '.$this->get_ua_id().' and tr_deleted = 0;');
} }
public static function create_user($_name, $_password) { public static function create_user($_name, $_password) {

View File

@@ -531,17 +531,17 @@ class user_kid extends user_parent {
if ($_de->get_de_type() == 'training') { if ($_de->get_de_type() == 'training') {
//ha edzés, akkor -1200 levonás, kivéve, ha kedvezményes: //ha edzés, akkor -1200 levonás, kivéve, ha kedvezményes:
//1-nél több edzés / nap //1-nél több edzés / nap
//8-nál több edzés / hónap //10-nál több edzés / hónap
//első két alkalom egyike //első két alkalom egyike
//var_dump($_de); //var_dump($_de);
//echo $_de->get_de_first_two() . '<br>'; //echo $_de->get_de_first_two() . '<br>';
//echo $_de->get_de_training_per_month() . '<br>'; //echo $_de->get_de_training_per_month() . '<br>';
//echo $_de->get_de_training_per_day() . '<br><br><br>'; //echo $_de->get_de_training_per_day() . '<br><br><br>';
if ($_de->get_de_first_two() > 0 || $_de->get_de_training_per_month() > 8 || $_de->get_de_training_per_day() > 1) { if ($_de->get_de_first_two() > 0 || $_de->get_de_training_per_month() > 10 || $_de->get_de_training_per_day() > 1) {
//do nothing //do nothing
$_de->set_de_transaction(0); $_de->set_de_transaction(0);
$_de->set_de_has_discount(true); $_de->set_de_has_discount(true);
//TODO: ha van már havi 8+ akk ne nézze a duplázót! //TODO: ha van már havi 10+ akk ne nézze a duplázót!
if ($_de->get_de_first_two() > 0) $_de->set_de_discount_id(1); if ($_de->get_de_first_two() > 0) $_de->set_de_discount_id(1);
if ($_de->get_de_training_per_day() > 1) $_de->set_de_discount_id(3); if ($_de->get_de_training_per_day() > 1) $_de->set_de_discount_id(3);
if ($_de->get_de_training_per_month() > 10) $_de->set_de_discount_id(2); if ($_de->get_de_training_per_month() > 10) $_de->set_de_discount_id(2);