* fixed displaying Premium Account days v2

This commit is contained in:
slawkens1
2018-01-08 00:17:49 +01:00
parent f157402fa3
commit 35acec1be5
2 changed files with 11 additions and 2 deletions

View File

@@ -341,6 +341,10 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
return round(($this->data['premend'] - time()) / (24 * 60 * 60), 2);
}
if($this->data['premdays'] == 0) {
return 0;
}
global $config;
if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return -1;
return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));