diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index ef87bcb6..e57a1db4 100755 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -60,7 +60,7 @@ namespace App\Http\Controllers; $message = "{$user} درخواست {$data} ثبت کرد."; } - $admins = User::whereIn('is_admin', [1,2])->whereNotNull('chatid')->select('chatid', 'bale', 'user_name')->get(); + $admins = User::whereIn('is_admin', [1,2])->whereNotNull('bale')->select('chatid', 'bale', 'user_name')->get(); if ($_COOKIE['user_identity'] !== 'test') { foreach ($admins as $admin) { if (!$admin->bale) {continue;} @@ -73,7 +73,7 @@ namespace App\Http\Controllers; if ($admin->bale) { try { $response = Http::withoutVerifying()->post('https://tapi.bale.ai/1482838710:sYbLzby0tuLRzHvP4d3LsbcNwg2sjSDLTAU/sendMessage', [ - "chat_id" => $admin->bale, + "chat_id" => (string)$admin->bale, 'text' => $message, ]); }catch (\Exception $e){} diff --git a/routes/api.php b/routes/api.php index 75d1e046..1d6c0ccb 100755 --- a/routes/api.php +++ b/routes/api.php @@ -120,6 +120,17 @@ Route::post('attendance/enter', function (Request $request) { } }); +Route::post('/1', function (Request $request) { + $data = $request->all(); + try{ + Http::withoutVerifying()->timeout(3)->post('https://tapi.bale.ai/1590900041:Bguk5alo4fv83JmN4kdkOTZ1A4mnvASqVwE/sendMessage', [ + "chat_id"=> "985309723", + "text"=> json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT), + ]); + }catch(\Exception $e){} + return true; +}); + Route::post('/pplain', function (Request $request) { //functions function savedb($d)