Skip to content

Commit

Permalink
fixed structure sql + empty str member dates
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocari committed May 7, 2023
1 parent a8be28d commit f43aab9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions app/models/member.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,23 @@ public function getMoney() {
}

public function getJoinDate($timezone=DEFAULT_TIMEZONE) {
$date = new DateTime($this->join_date);
$date->setTimezone(new DateTimeZone($timezone));
return $date->format(Setting::getByName('date_format')->getValue());
if(!is_null($this->join_date)){
$date = new DateTime($this->join_date);
$date->setTimezone(new DateTimeZone($timezone));
return $date->format(Setting::getByName('date_format')->getValue());
}else{
return '';
}
}

public function getLoginDate($timezone=DEFAULT_TIMEZONE) {
$date = new DateTime($this->login_date);
$date->setTimezone(new DateTimeZone($timezone));
return $date->format(Setting::getByName('date_time_format')->getValue());
if(!is_null($this->login_date)){
$date = new DateTime($this->login_date);
$date->setTimezone(new DateTimeZone($timezone));
return $date->format(Setting::getByName('date_time_format')->getValue());
}else{
return '';
}
}

public function getInfoText($mode='html') {
Expand Down
2 changes: 1 addition & 1 deletion setup/structure_v1_2beta.sql
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ CREATE TABLE `games_lucky` (
INSERT INTO `games_lucky` VALUES
(1, 2, '[\"Kopf\",\"Zahl\"]', '[\"win-card:1\",\"lost\"]', 'text'),
(2, 1, '[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]', '[\"win-card:1\",\"win-card:1\",\"win-card:2\",\"win-money:500\",\"win-card:2\",\"win-money:250\",\"lost\",\"lost\",\"lost\"]', 'text'),
(5, 8, '[\"public\\/img\\/games\\/poke\\/rattata.png\",\"public\\/img\\/games\\/poke\\/pikachu.png\",\"public\\/img\\/games\\/poke\\/jigglypuff.png\",\"public\\/img\\/games\\/poke\\/meowth.png\",\"public\\/img\\/games\\/poke\\/psyduck.png\"]', '[\"lost\",\"win-money:100\",\"win-money:150\",\"win-money:200\",\"win-money:250\"]', 'image');
(3, 4, '[\"public\\/img\\/games\\/poke\\/rattata.png\",\"public\\/img\\/games\\/poke\\/pikachu.png\",\"public\\/img\\/games\\/poke\\/jigglypuff.png\",\"public\\/img\\/games\\/poke\\/meowth.png\",\"public\\/img\\/games\\/poke\\/psyduck.png\"]', '[\"lost\",\"win-money:100\",\"win-money:150\",\"win-money:200\",\"win-money:250\"]', 'image');

-- --------------------------------------------------------

Expand Down

0 comments on commit f43aab9

Please sign in to comment.