v.2.27
Fixed reports
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\Client;
|
||||
use App\Component\Models\ClientsBonus;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class POSTBonus extends HRCCommand implements HRCCommandInterface
|
||||
@@ -13,13 +15,17 @@ class POSTBonus extends HRCCommand implements HRCCommandInterface
|
||||
|
||||
public function command($input, $output = null)
|
||||
{
|
||||
$client_guid = $input['client_id'];
|
||||
$client_guid = $input['client_guid'];
|
||||
$bonus_amount = abs($input['amount']);
|
||||
$staff_id = $input['who'];
|
||||
$staff_id = $input['who_id'];
|
||||
$bonus_time = $input['date_transaction'];
|
||||
$type = $input['type'];
|
||||
ClientsBonus::bonusReg($client_guid, $bonus_amount, $type);
|
||||
ClientsBonus::bonusLog($client_guid, $bonus_amount, $bonus_time, $staff_id);
|
||||
$client = Client::where('user_code', $client_guid)->first();
|
||||
$client = Client::find($client['id']);
|
||||
$client->updated_at = Carbon::createFromTimestampUTC($bonus_time)->timezone('Europe/Minsk');
|
||||
$client->save();
|
||||
if ($type == 'in') {
|
||||
$message = 'Начислено ' . $bonus_amount . ' бонусов';
|
||||
} elseif ($type == 'out') {
|
||||
|
||||
Reference in New Issue
Block a user