v.2.24
1. POSTBonus in/out 2. POSTPresale in/out 3. Переработана форма гостя
This commit is contained in:
34
commands/POSTBonus.php
Normal file
34
commands/POSTBonus.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\ClientsBonus;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class POSTBonus extends HRCCommand implements HRCCommandInterface
|
||||
{
|
||||
protected $signature = 'postbonus';
|
||||
|
||||
public function command($input, $output = null)
|
||||
{
|
||||
$client_guid = $input['client_id'];
|
||||
$bonus_amount = $input['amount'];
|
||||
$staff_id = $input['who'];
|
||||
$bonus_time = $input['date_transaction'];
|
||||
ClientsBonus::bonusReg($client_guid, $bonus_amount);
|
||||
ClientsBonus::bonusLog($client_guid, $bonus_amount, $bonus_time, $staff_id);
|
||||
if ($bonus_amount > 0) {
|
||||
$message = 'Начислено ' . $bonus_amount . ' бонусов';
|
||||
} else {
|
||||
$message = 'Списано ' . abs($bonus_amount) . ' бонусов';
|
||||
}
|
||||
$bonus_result = ClientsBonus::getBonus($client_guid);
|
||||
return [
|
||||
'status' => 'success',
|
||||
'message' => $message,
|
||||
'result' => $bonus_result
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user