gift added to tahesab

This commit is contained in:
2026-05-28 11:53:27 +03:30
parent 98d62dd5d3
commit abdfff6281
4 changed files with 203 additions and 69 deletions
@@ -235,6 +235,18 @@ class CustomerController extends Controller
'withdraw_id' => $Withdraw->id,
]);
$referrerWallet = Wallet::where('owner', $customer->referral->id)->first();
if($this->Config('send_to_tahesab') == "true"){
try {
$tahesab = new TahesabController();
$tahesab->walletGold([
'customer_id'=> $customer->id,
'value'=> $gift_for_inviter,
'direction'=> 0
]);
}catch (\Exception $e){
return response($e->getMessage(), 500);
}
}
$message = "سلام {$referrer->name} عزیز،\n\n{$gift_for_inviter} گرم طلا بابت معرفی {$customer->name} به حساب شما واریز شد.\nموجودی فعلی: {$referrerWallet->gold} گرم.\n\nاطلاعات بیشتر: $companyurl\n\nبا احترام،\n$companyName";
$this->Send($referrer->mobile, $message);
}
@@ -272,6 +284,18 @@ class CustomerController extends Controller
'withdraw_id' => $Withdraw->id,
]);
$referrerWallet = Wallet::where('owner', $customer->id)->first();
if($this->Config('send_to_tahesab') == "true"){
try {
$tahesab = new TahesabController();
$tahesab->walletGold([
'customer_id'=> $customer->id,
'value'=> $gift_for_inviter,
'direction'=> 0
]);
}catch (\Exception $e){
return response($e->getMessage(), 500);
}
}
$message = "سلام " . $customer->name . " عزیز،\n\n" . $gift_for_invited . " گرم طلا بابت ثبت نام " . " به حساب شما واریز شد.\n" . "موجودی فعلی: " . $referrerWallet->gold . " گرم.\n\n" . "اطلاعات بیشتر: " . $companyurl . "\n\n" . "با احترام،\n" . $companyName;
$this->Send($customer->mobile, $message);
}
@@ -286,7 +310,6 @@ class CustomerController extends Controller
// return response()->json(['response' => $response], 422);
// }
return response()->json(['message' => "کد ملی ثبت شد، اما در حال حاضر سیستم نتوانست آن را تأیید کند. لطفاً منتظر بررسی و تأیید مدیر بمانید.",'response' =>$response], 422);
}