mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	telegram: order notify
This commit is contained in:
		| @@ -1,6 +1,7 @@ | ||||
| <?php | ||||
| namespace App\Services; | ||||
|  | ||||
| use App\Jobs\SendTelegramJob; | ||||
| use \Curl\Curl; | ||||
|  | ||||
| class TelegramService { | ||||
| @@ -43,4 +44,15 @@ class TelegramService { | ||||
|         } | ||||
|         return $response; | ||||
|     } | ||||
|  | ||||
|     public function sendMessageWithAdmin($message) | ||||
|     { | ||||
|         if (!config('v2board.telegram_bot_enable', 0)) return; | ||||
|         $users = User::where('is_admin', 1) | ||||
|             ->where('telegram_id', '!=', NULL) | ||||
|             ->get(); | ||||
|         foreach ($users as $user) { | ||||
|             SendTelegramJob::dispatch($user->telegram_id, $message); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user