1. POSTBonus in/out
2. POSTPresale in/out
3. Переработана форма гостя
This commit is contained in:
miroman-afk
2022-12-14 12:42:39 +03:00
parent 4d3ad7727d
commit d24bba305f
49 changed files with 2525 additions and 772 deletions

33
commands/POSTPresale.php Normal file
View 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
];
}
}