API v.1.5: Update, Delete clients
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\Client;
|
||||
use App\Component\Models\ClientsAddress;
|
||||
use App\Component\Models\ClientsBarcode;
|
||||
use App\Component\Models\ClientsEmail;
|
||||
use App\Component\Models\ClientsGroup;
|
||||
use App\Component\Models\ClientsPhone;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
@@ -41,7 +44,19 @@ class Clients extends HRCCommand implements HRCCommandInterface {
|
||||
|
||||
foreach ($clients as $client) {
|
||||
$phone = ClientsPhone::where('client_guid', '=', $client['user_code'])->first();
|
||||
$out[] = array('id' => $client['id'], 'name' => $client['name'], 'phone' => $phone['phone']);
|
||||
$email = ClientsEmail::where('client_guid', '=', $client['user_code'])->first();
|
||||
$address = ClientsAddress::where('client_guid', '=', $client['user_code'])->first();
|
||||
$barcode = ClientsBarcode::where('client_guid', '=', $client['user_code'])->first();
|
||||
$group = ClientsGroup::where('code', '=', $client['group_id'])->first();
|
||||
$out[] = array(
|
||||
'id' => $client['id'],
|
||||
'client_group' => $group['id'],
|
||||
'name' => $client['name'],
|
||||
'phone' => $phone['phone'],
|
||||
'email' => $email['email'],
|
||||
'address' => $address['address'],
|
||||
'barcode' => $barcode['code_id'],
|
||||
);
|
||||
}
|
||||
return [
|
||||
'status' => 'success',
|
||||
|
||||
Reference in New Issue
Block a user