NASER fix telegram messages and calculte price for products and fix bugs for fee free
This commit is contained in:
@@ -80,32 +80,20 @@ class Controller extends BaseController
|
||||
$send_sms = true;
|
||||
$user = User::where('mobile', $to)->first() ?: Customer::where('mobile', $to)->first();
|
||||
if ($user) {
|
||||
if ($send_sms or $force_method=="sms") {
|
||||
$endpoint = "http://www.0098sms.com/sendsmslink.aspx";
|
||||
$response = Http::get($endpoint, [
|
||||
'FROM' => $credentials['sms']['sender'],
|
||||
'TO' => $to,
|
||||
'TEXT' => trim($msg),
|
||||
'USERNAME' => $credentials['sms']['user_name'],
|
||||
'PASSWORD' => $credentials['sms']['password'],
|
||||
'DOMAIN' => '0098',
|
||||
]);
|
||||
$platforms[] = "0098:{$to}";
|
||||
|
||||
}
|
||||
// Telegram
|
||||
// if (isset($credentials['telegram']) && $user->telegram) {
|
||||
// try {
|
||||
// Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
||||
// 'botToken' => $credentials['telegram']['token'],
|
||||
// 'chatId' => $user->telegram,
|
||||
// 'message' => "جناب {$user->name} {$msg}",
|
||||
// ]);
|
||||
// $platforms[] = "telegram:{$user->telegram}";
|
||||
// $send_sms = false;
|
||||
// } catch (\Exception $e) {
|
||||
// }
|
||||
// }
|
||||
if (isset($credentials['telegram']) && $user->telegram) {
|
||||
try {
|
||||
Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
||||
'botToken' => $credentials['telegram']['token'],
|
||||
'chatId' => $user->telegram,
|
||||
'message' => "جناب {$user->name} {$msg}",
|
||||
]);
|
||||
$platforms[] = "telegram:{$user->telegram}";
|
||||
$send_sms = false;
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
// Bale
|
||||
if (isset($credentials['bale']) && $user->bale) {
|
||||
@@ -122,6 +110,20 @@ class Controller extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
//SMS
|
||||
if ($send_sms or $force_method=="sms") {
|
||||
$endpoint = "http://www.0098sms.com/sendsmslink.aspx";
|
||||
$response = Http::get($endpoint, [
|
||||
'FROM' => $credentials['sms']['sender'],
|
||||
'TO' => $to,
|
||||
'TEXT' => trim($msg),
|
||||
'USERNAME' => $credentials['sms']['user_name'],
|
||||
'PASSWORD' => $credentials['sms']['password'],
|
||||
'DOMAIN' => '0098',
|
||||
]);
|
||||
$platforms[] = "0098:{$to}";
|
||||
|
||||
}
|
||||
|
||||
Message::create([
|
||||
'sms' => $msg,
|
||||
|
||||
Reference in New Issue
Block a user