NASER fix send sms error
This commit is contained in:
@@ -79,44 +79,44 @@ class Controller extends BaseController
|
|||||||
$platforms = [];
|
$platforms = [];
|
||||||
$send_sms = true;
|
$send_sms = true;
|
||||||
$user = User::where('mobile', $to)->first() ?: Customer::where('mobile', $to)->first();
|
$user = User::where('mobile', $to)->first() ?: Customer::where('mobile', $to)->first();
|
||||||
if ($user) {
|
// if ($user) {
|
||||||
|
//
|
||||||
// Telegram
|
// // Telegram
|
||||||
if (isset($credentials['telegram']) && $user->telegram) {
|
// if (isset($credentials['telegram']) && $user->telegram) {
|
||||||
try {
|
// try {
|
||||||
$res = Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
// $res = Http::get("https://api.wwwapp.ir/telegran_send.php", [
|
||||||
'botToken' => $credentials['telegram']['token'],
|
// 'botToken' => $credentials['telegram']['token'],
|
||||||
'chatId' => $user->telegram,
|
// 'chatId' => $user->telegram,
|
||||||
'message' => "جناب {$user->name} {$msg}",
|
// 'message' => "جناب {$user->name} {$msg}",
|
||||||
]);
|
// ]);
|
||||||
$data = $res->json();
|
// $data = $res->json();
|
||||||
if (isset($data['success']) && $data['success'] === true) {
|
// if (isset($data['success']) && $data['success'] === true) {
|
||||||
$platforms[] = "telegram:{$user->telegram}";
|
// $platforms[] = "telegram:{$user->telegram}";
|
||||||
$send_sms = false;
|
// $send_sms = false;
|
||||||
}
|
// }
|
||||||
} catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Bale
|
// // Bale
|
||||||
if (isset($credentials['bale']) && $user->bale) {
|
// if (isset($credentials['bale']) && $user->bale) {
|
||||||
try {
|
// try {
|
||||||
Http::get("https://api.wwwapp.ir/bale_send.php", [
|
// Http::get("https://api.wwwapp.ir/bale_send.php", [
|
||||||
'botToken' => $credentials['bale']['token'],
|
// 'botToken' => $credentials['bale']['token'],
|
||||||
'chatId' => $user->bale,
|
// 'chatId' => $user->bale,
|
||||||
'message' => "جناب {$user->name} {$msg}",
|
// 'message' => "جناب {$user->name} {$msg}",
|
||||||
]);
|
// ]);
|
||||||
$platforms[] = "bale:{$user->bale}";
|
// $platforms[] = "bale:{$user->bale}";
|
||||||
$send_sms = false;
|
// $send_sms = false;
|
||||||
} catch (\Exception $e) {
|
// } catch (\Exception $e) {
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//SMS
|
//SMS
|
||||||
if ($send_sms or $force_method=="sms") {
|
if ($send_sms or $force_method=="sms") {
|
||||||
$endpoint = "http://www.0098sms.com/sendsmslink.aspx";
|
$endpoint = "http://www.0098sms.com/sendsmslink.aspx";
|
||||||
$response = Http::get($endpoint, [
|
$response = Http::withoutVerifying()->get($endpoint, [
|
||||||
'FROM' => $credentials['sms']['sender'],
|
'FROM' => $credentials['sms']['sender'],
|
||||||
'TO' => $to,
|
'TO' => $to,
|
||||||
'TEXT' => trim($msg),
|
'TEXT' => trim($msg),
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class BankAccountController extends SuperController
|
|||||||
$message .= $this->Config('name_fa');
|
$message .= $this->Config('name_fa');
|
||||||
|
|
||||||
User::where('active', 1) ->where('send_sms', 1)->get()->each(function($admin) use ($message) {
|
User::where('active', 1) ->where('send_sms', 1)->get()->each(function($admin) use ($message) {
|
||||||
$this->Send($admin->mobile, $message);
|
// $this->Send($admin->mobile, $message);
|
||||||
});
|
});
|
||||||
$data = $request->only(['account_number', 'bank_name', 'cart_number', 'shaba_number', 'customer_id']);
|
$data = $request->only(['account_number', 'bank_name', 'cart_number', 'shaba_number', 'customer_id']);
|
||||||
BankAccount::create($data);
|
BankAccount::create($data);
|
||||||
|
|||||||
Reference in New Issue
Block a user