Merge pull request #230 from 1day2die/fix_SERVER_LIMIT_REWARD_

Fix server limit reward
This commit is contained in:
AVMG 2021-10-19 19:49:45 +02:00 committed by GitHub
commit d71bc134fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,12 +141,12 @@ class PaymentController extends Controller
$user->increment('credits', $paypalProduct->quantity);
//update server limit
if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10) !== 0) {
if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE', 10)) {
$user->update(['server_limit' => 10]);
if (Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE') !== 0) {
if ($user->server_limit < Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')) {
$user->update(['server_limit' => Configuration::getValueByKey('SERVER_LIMIT_AFTER_IRL_PURCHASE')]);
}
}
//update role
if ($user->role == 'member') {
$user->update(['role' => 'client']);