Small fix
This commit is contained in:
miroman-afk
2022-12-22 12:52:42 +03:00
parent d24bba305f
commit 723e9a8768
15 changed files with 213 additions and 117 deletions

View File

@@ -14,15 +14,16 @@ class POSTBonus extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null)
{
$client_guid = $input['client_id'];
$bonus_amount = $input['amount'];
$bonus_amount = abs($input['amount']);
$staff_id = $input['who'];
$bonus_time = $input['date_transaction'];
ClientsBonus::bonusReg($client_guid, $bonus_amount);
$type = $input['type'];
ClientsBonus::bonusReg($client_guid, $bonus_amount, $type);
ClientsBonus::bonusLog($client_guid, $bonus_amount, $bonus_time, $staff_id);
if ($bonus_amount > 0) {
if ($type == 'in') {
$message = 'Начислено ' . $bonus_amount . ' бонусов';
} else {
$message = 'Списано ' . abs($bonus_amount) . ' бонусов';
} elseif ($type == 'out') {
$message = 'Списано ' . $bonus_amount . ' бонусов';
}
$bonus_result = ClientsBonus::getBonus($client_guid);
return [