v.2.25
Small fix
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user