Обновлен перенос клиента из группы в группу
Обновлен метод восстановления смены
Добавлен метод загрузки меню 1с из облака
This commit is contained in:
miroman-afk
2022-07-25 23:26:44 +03:00
parent 9c3b633098
commit 1af2b267f5
14 changed files with 1848 additions and 309 deletions

View File

@@ -10,6 +10,7 @@ use App\Component\Models\ClientsGroup;
use App\Component\Models\ClientsPhone;
use App\Console\Commands\HRCCommand;
use App\Console\Commands\HRCCommandInterface;
use Illuminate\Support\Facades\Log;
class POSTClient extends HRCCommand implements HRCCommandInterface {
protected $signature = 'postclient';
@@ -18,18 +19,17 @@ class POSTClient extends HRCCommand implements HRCCommandInterface {
if (isset($input['task']) && isset($input['id'])) {
if ($input['task'] == 'update') {
$phone = urldecode($input['phone']);
$client = Client::find($input['id']);
$client->name = urldecode($input['name']);
$client->unloaded = 0;
$clientGroup = ClientsGroup::find($input['group_id']);
$clientGroup = ClientsGroup::where('id', $input['group_id'])->first();
$client->group_id = urldecode($clientGroup['code']);
$clientPhone = ClientsPhone::where('client_guid', $client->user_code)->first();
if ($clientPhone) {
$clientPhone = ClientsPhone::find($clientPhone['id']);
if ($input['phone'] !== '') {
if (substr($input['phone'], 0, 1) == '+') {
if ($phone !== '' && $phone !== '+375 ( ) - -') {
if (substr($phone, 0, 1) == '+') {
$phoneData = urldecode($input['phone']);
} else {
$phoneData = urldecode($input['phone']);
@@ -74,8 +74,7 @@ class POSTClient extends HRCCommand implements HRCCommandInterface {
$clientBarcode->save();
}
$client->save();
$clientGroup->save();
$client->save();
return [
'status' => 'success',