v.2.24
1. POSTBonus in/out 2. POSTPresale in/out 3. Переработана форма гостя
This commit is contained in:
33
commands/POSTPresale.php
Normal file
33
commands/POSTPresale.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\ClientsPresale;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class POSTPresale extends HRCCommand implements HRCCommandInterface
|
||||
{
|
||||
protected $signature = 'postpresale';
|
||||
|
||||
public function command($input, $output = null)
|
||||
{
|
||||
$client_guid = $input['client_id'];
|
||||
$presale_amount = $input['amount'];
|
||||
$staff_id = $input['who'];
|
||||
$presale_time = $input['date_transaction'];
|
||||
ClientsPresale::presaleReg($client_guid, $presale_amount);
|
||||
ClientsPresale::presaleLog($client_guid, $presale_amount, $presale_time, $staff_id);
|
||||
if ($presale_amount > 0) {
|
||||
$message = 'Внесен аванс на сумму ' . $presale_amount . ' BYN';
|
||||
} else {
|
||||
$message = 'Зачтен аванс на сумму ' . abs($presale_amount) . ' BYN';
|
||||
}
|
||||
$presale_result = ClientsPresale::getPresale($client_guid);
|
||||
return [
|
||||
'status' => 'success',
|
||||
'message' => $message,
|
||||
'result' => $presale_result
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user