77 lines
2.3 KiB
PHP
77 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use League\Csv\Reader;
|
|
use Illuminate\Support\Facades\Http;
|
|
use App\Http\Requests\LambdaRequest;
|
|
use Log;
|
|
use DB;
|
|
use App\Models\User;
|
|
//use App\Models\Paramedics;
|
|
|
|
class importmetricdataCode extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'lms:removecontacts';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
protected $authkey = '6bf9faa1-408e-4905-9da4-660b45a2331c';
|
|
protected $source_identifier = 'test_metric_data';
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
$contacts = ['1694196015-6c08cd64-bcfa-4f99-803f-75baa41f262d',
|
|
'1694429827-86b0b6da-59c0-4394-942e-555443ab4cd5',
|
|
'1694568969-601362a1-4bf5-4d5a-8e6e-3e62167a2858',
|
|
'1694569071-e9cd38bd-b674-4f40-bc12-d2366cc47f06',
|
|
'1694600020-27291e3d-3441-4504-bf12-d63031f3714f',
|
|
'1694600208-df00a434-596a-47fe-a7de-d794eef1c0dc',
|
|
'1694600300-48899a65-586e-4e15-bd9a-3dcdb8d23bee',
|
|
'1694601463-5bde26e4-daaa-4330-a532-d38ba0cbf379',
|
|
'1694774085-0c099eec-2404-4dca-bb89-0f97c94817da',
|
|
'1695095730-49684e34-f883-474d-8b50-45c27b566075',
|
|
'1695095859-0b7a0959-aa9a-4720-8d6e-58187173b523',
|
|
'1701170264-61379d70-0e7a-4e4d-9490-585fdc3c4b64',
|
|
'1702622337-159fdc80-f13d-4258-8832-88af86830daf',
|
|
'1702622338-18b54f72-aaa3-4eda-ac37-a1808d784e80',
|
|
'1702623256-df02949a-963e-49e6-9d3b-6afdf4814622',
|
|
'1702646051-9832d80e-64fa-4797-82cf-42cb927c91b8',
|
|
'1693984180-5adc1877-a236-4004-adf1-5ec3edf7ab58',
|
|
'1693987473-91dd50eb-987a-4b7f-a8a3-99ddc9f69a81',
|
|
'1703135532-26060013-8c0a-47ec-8e1f-945a633907b3',
|
|
'1703136702-13a5ce38-b9fb-475a-a9ac-f2184c90f112',];
|
|
|
|
$updatedContacts = [];
|
|
foreach($contacts as $cid) {
|
|
$response = LambdaRequest::getrequest('contact', 'contact/delete', ['id' => $cid ], env('LAMBDA_ACCESS_TOKEN') );
|
|
print_r($response);
|
|
DB::table("lms_users")->where('contact_id', $cid)->delete();
|
|
}
|
|
}
|
|
} |