new feature on sms and some bugs fixed

This commit is contained in:
2026-07-18 22:22:01 +03:30
parent 518334da11
commit fc9de5198c
20 changed files with 489 additions and 95 deletions
@@ -97,9 +97,11 @@ class BankAccountController extends SuperController
} else {
$message = "احرازهویت برای شماره کارت کاربر " . $user->name . " توسط جیبیت انجام نشد. لطفا از پنل ادمین اقدام کنید. ";
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->SendMessage($admin->mobile, $message);
});
if (self::isSmsNotifEnabled('sms_notif_bank_card_admin')) {
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->SendMessage($admin->mobile, $message);
});
}
$BA = BankAccount::create([
'customer_id' => $user->id,
'cart_number' => $request->cart_number,
@@ -115,9 +117,11 @@ class BankAccountController extends SuperController
$message = "کارت جدیدی برای $customer->name ساخته شد منتظر تایید شما هستیم.";
$message .= $this->Config('name_fa');
User::where('active', 1) ->where('send_sms', 1)->get()->each(function($admin) use ($message) {
$this->Send($admin->mobile, $message);
});
if (self::isSmsNotifEnabled('sms_notif_bank_card_admin')) {
User::where('active', 1)->where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->Send($admin->mobile, $message);
});
}
$data = $request->only(['account_number', 'bank_name', 'cart_number', 'shaba_number', 'customer_id']);
BankAccount::create($data);
return response()->json($data);
@@ -58,6 +58,7 @@ class SingleOrderController extends Controller
if (!$customer || !$customer->trade_active) {
throw new UnprocessableEntityHttpException('امکان سفارش برای شما غیرفعال است.');
}
self::assertCustomerIdentityVerified($customer);
$data['customer_id'] = auth('customer')->id();
@@ -778,9 +779,11 @@ class SingleOrderController extends Controller
$message = "کاربر {$customer->name} با شماره موبایل {$customer->mobile} اقدام به $transactionType {$subjectTitle} به مقدار " .
"{$amount} گرم به مبلغ " . number_format($totalPrice) .
" ریال کرد. با تشکر، $companyName";
User::where('send_sms', 1)->get()->each(function ($admin) use ($message, $data, $transactionType, $companyName) {
$this->send($admin->mobile, $message);
});
if (self::isSmsNotifEnabled('sms_notif_order_admin')) {
User::where('send_sms', 1)->get()->each(function ($admin) use ($message) {
$this->send($admin->mobile, $message);
});
}
$wallet = Wallet::where('owner', $data['customer_id'])
->whereNull('fund_id')
->whereNull('product_id')
@@ -795,8 +798,9 @@ class SingleOrderController extends Controller
$this->Config('app_url');
// ارسال SMS به مشتری
$this->send($customer->mobile, $customerMessage);
if (self::isSmsNotifEnabled('sms_notif_order_customer')) {
$this->send($customer->mobile, $customerMessage);
}
}
private function assertProviderOrderAccepted(array &$data): void