atou order
This commit is contained in:
parent
b6370980e6
commit
ee45342d7f
|
|
@ -36,126 +36,16 @@ class OrderController extends Controller
|
|||
if (!$admin) {
|
||||
return response()->json(['error' => 'ادمین لاگین نکرده است'], 401);
|
||||
}
|
||||
$customerId = $request->input('customer_id');
|
||||
$customerId = $request->input('customer_id');
|
||||
if (!$customerId) {
|
||||
return response()->json(['error' => 'شناسه مشتری ارسال نشده است'], 422);
|
||||
}
|
||||
$selectedUser = $customer = \App\Models\Customer::find($customerId);
|
||||
$selectedUser = $customer = \App\Models\Customer::find($customerId);
|
||||
if (!$customer) {
|
||||
return response()->json(['error' => 'مشتری یافت نشد'], 404);
|
||||
}
|
||||
$customerOrderController = new CustomerOrderController();
|
||||
return $customerOrderController->store($request,$selectedUser);
|
||||
|
||||
|
||||
$data = $request->all();
|
||||
|
||||
// $request = new Request([
|
||||
// "direction"=>$request->direction,
|
||||
// "price"=>$request->price,
|
||||
// "pay_at"=>$request->pay_at,
|
||||
// "amount"=>$request->amount,
|
||||
// "customer_id"=>23,
|
||||
// "product_id"=>2,
|
||||
// "description"=>$request->description,
|
||||
// "cash"=>$request->payment_amount,
|
||||
// ]);
|
||||
|
||||
// Check if an order with the same amount, direction, customer_id, and created_at already exists
|
||||
$existingOrder = Order::where('amount', $data['amount'])
|
||||
->where('direction', $data['direction'])
|
||||
->where('customer_id', $data['customer_id'])
|
||||
->where('pay_at', $data['pay_at'])
|
||||
->first();
|
||||
|
||||
if ($existingOrder) {
|
||||
return response()->json(['message' => 'Duplicate order detected'], 422);
|
||||
}
|
||||
|
||||
// If no duplicate order exists, create the new order
|
||||
|
||||
|
||||
$Customer = Customer::where('id', $data['customer_id'])->first();
|
||||
$product = Product::find($data['product_id']);
|
||||
|
||||
$add_sell_price = 0;
|
||||
$PriceMain = Price::where('product_id', $data['product_id'])->orderBy('id', 'desc')->first();
|
||||
|
||||
$mesghal_convert = config('change_mesghal');
|
||||
$data['price'] = (float)$data['price'] / $mesghal_convert;
|
||||
$base = Package::where('is_base', true)->first();
|
||||
$package_base = PackageProduct::where('package_id', $base->id)->where('product_id', $data['product_id'])->first();
|
||||
$package = null;
|
||||
$package = PackageProduct::where('package_id', $Customer->package_id)->where('product_id', $data['product_id'])->first();
|
||||
|
||||
$data['customer_id'] = $Customer->id;
|
||||
$data['sts'] = 1;
|
||||
$data['payment_sts'] = 1;
|
||||
$data['type'] = $Customer->type;
|
||||
|
||||
$response['credit'] = $credit = CustomerCredit::firstOrCreate(
|
||||
['product_id' => $data['product_id'], 'customer_id' => $Customer->id,],
|
||||
['product_id' => $data['product_id'], 'customer_id' => $Customer->id,
|
||||
'buy_credit' => $product->default_credit, 'sell_credit' => $product->default_credit]);
|
||||
|
||||
if ($data['direction'] == 1) {
|
||||
if (!is_null($package_base)) {
|
||||
$add_sell_price = $package_base->buy_gram_price;
|
||||
$data['fee_master'] = $add_sell_price;
|
||||
$data['total_fee_master'] = $add_sell_price * $data['amount'];
|
||||
}
|
||||
if (!is_null($package)) {
|
||||
$add_sell_price += $package->buy_gram_price;
|
||||
$data['fee_agent'] = $package->buy_gram_price;
|
||||
$data['total_fee_agent'] = $package->buy_gram_price * $data['amount'];
|
||||
}
|
||||
$data['price_original'] = $data['price'];
|
||||
$data['price_original_in_mesghal'] = round($data['price'] * $mesghal_convert, -3);
|
||||
$data['total_price_original'] = $data['amount'] * $data['price_original'];
|
||||
$data['price_in_mesghal'] = round($data['price'] * $mesghal_convert, -3);
|
||||
$remain = $credit->buy_credit - $credit->blocked_buy_credit;
|
||||
CustomerCredit::find($credit->id)->update([
|
||||
'blocked_buy_credit' => $credit->blocked_buy_credit + $data['amount']
|
||||
]);
|
||||
} else {
|
||||
if (!is_null($package_base)) {
|
||||
$add_sell_price = $package_base->sell_gram_price;
|
||||
$data['fee_master'] = $add_sell_price;
|
||||
$data['total_fee_master'] = $add_sell_price * $data['amount'];
|
||||
}
|
||||
if (!is_null($package)) {
|
||||
$add_sell_price += $package->sell_gram_price;
|
||||
$data['fee_agent'] = $package->sell_gram_price;
|
||||
$data['total_fee_agent'] = $package->sell_gram_price * $data['amount'];
|
||||
}
|
||||
$data['price_original'] = $data['price'];
|
||||
$data['price_original_in_mesghal'] = round($data['price'] * $mesghal_convert, -3);
|
||||
$data['total_price_original'] = $data['amount'] * $data['price_original'];
|
||||
$data['price_in_mesghal'] = round($data['price'] * $mesghal_convert, -3);
|
||||
$remain = $credit->sell_credit - $credit->blocked_sell_credit;
|
||||
if ($remain < $data['amount']) {
|
||||
throw new UnprocessableEntityHttpException('مقدار وارد شده بیش از سقف اعتبار شماست');
|
||||
}
|
||||
CustomerCredit::find($credit->id)->update([
|
||||
'blocked_sell_credit' => $credit->blocked_sell_credit + $data['amount']
|
||||
]);
|
||||
}
|
||||
$data['total_price'] = $data['amount'] * $data['price'];
|
||||
$data['payment_remind'] = 0;
|
||||
$data['payment_amount'] = $data['total_price'];
|
||||
$data['agent_id'] = $Customer->agent_id;;
|
||||
$data['total_price_round'] = round($data['total_price'], -6);
|
||||
$data['price_id'] = $PriceMain->id;
|
||||
$data['admin_id'] = Auth::user()->id ?? 2;
|
||||
$order = Order::create($data);
|
||||
$request = [
|
||||
'method' => $data["method"],
|
||||
'order_id' => $order->id,
|
||||
'sts' => 2,
|
||||
];
|
||||
$request = new Request($request);
|
||||
$NewOrder = $this->changeStatus($request, $data["pay_at"]);
|
||||
return response()->json($NewOrder);
|
||||
return $customerOrderController->store($request, $selectedUser);
|
||||
}
|
||||
|
||||
public function table(Request $request)
|
||||
|
|
@ -211,10 +101,34 @@ class OrderController extends Controller
|
|||
$records = Order::where('id', $request[0]['refTo'])->first();
|
||||
$records->finance_order = $request->all();
|
||||
$records->save();
|
||||
|
||||
// تبدیل نتیجه به JSON
|
||||
return response()->json($records);
|
||||
}
|
||||
|
||||
public function praskaVerifyS(Request $request)
|
||||
{
|
||||
if ($request->header('praska_token') !== $this->Config('praska_token')) {
|
||||
return response()->json(['auth needed'], 401);
|
||||
}
|
||||
if ($request->function == "order_verified") {
|
||||
if (!isset($request->id) || !($order = Order::find($request->id)) || $order->sts != 1) {
|
||||
return response()->json(['message' => 'invalid order'], 422);
|
||||
}
|
||||
if ($request->status == "انجام شده") {
|
||||
$request = new Request([
|
||||
'order_id' => $order->id,
|
||||
'sts' => 2,
|
||||
]);
|
||||
$ord= $this->changeStatus($request);
|
||||
}elseif ($request->status == "لغو شده") {
|
||||
$request = new Request([
|
||||
'order_id' => $order->id,
|
||||
'sts' => 4,
|
||||
]);
|
||||
$ord= $this->changeStatus($request);
|
||||
}
|
||||
}
|
||||
|
||||
return response()->json($ord??"no data");
|
||||
}
|
||||
|
||||
public function tableNew(Request $request)
|
||||
|
|
@ -245,9 +159,72 @@ class OrderController extends Controller
|
|||
|
||||
public function changeStatus(Request $request, $adminCustomDate = null)
|
||||
{
|
||||
$token = env('TOKEN_750_KALHOR');
|
||||
//from us
|
||||
$data = $request->all();
|
||||
$order = Order::with(['product.price'])->findOrFail($data['order_id']);
|
||||
if (isset($request->is_send_to_provider)) {
|
||||
try {
|
||||
// $order->sts =1;
|
||||
$order->provider_name = "در انتظار تایید " . $request->is_send_to_provider;
|
||||
$order->save();
|
||||
$response = Http::withHeaders([
|
||||
'praska_token' => $this->Config('praska_token'),
|
||||
])->post("https://nerkh.gold/services/{$request->is_send_to_provider}/order", [
|
||||
'direction' => $order->direction,
|
||||
'amount' => $order->amount,
|
||||
'caller_order_id' => $order->id,
|
||||
'service_id' => $request->service_id,
|
||||
'service_pid' => $request->service_pid,
|
||||
])->json();
|
||||
if (!isset($response['id'])){
|
||||
$order->update(['sts' => 4]);
|
||||
$trigerUrl = $this->trigerUrl();
|
||||
try {
|
||||
Http::withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
])->post($trigerUrl . '/prc/api/trigger-update', [
|
||||
'customer_id' => $order->customer_id,
|
||||
'order_id' => $order->id,
|
||||
'trigger' => 'send_order_sts',
|
||||
'status' => ($order->sts == 2) ? 'accept' : "reject ",
|
||||
]);
|
||||
} catch (\Exception $exception) {
|
||||
}
|
||||
return response()->json(['message' => "مشکل در ثبت"], 422);
|
||||
|
||||
}
|
||||
if (!isset($response['provider_id'])){
|
||||
$order->update(['sts' => 4]);
|
||||
$trigerUrl = $this->trigerUrl();
|
||||
try {
|
||||
Http::withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
])->post($trigerUrl . '/prc/api/trigger-update', [
|
||||
'customer_id' => $order->customer_id,
|
||||
'order_id' => $order->id,
|
||||
'trigger' => 'send_order_sts',
|
||||
'status' => ($order->sts == 2) ? 'accept' : "reject ",
|
||||
]);
|
||||
} catch (\Exception $exception) {
|
||||
}
|
||||
return response()->json(['message' => "مسئول تأیید سفارش در دسترس نمیباشد."], 422);
|
||||
}
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
// 'provider_id' => $response->provider_id,
|
||||
// 'id' => $response->id,
|
||||
// 'caller_id' => $response->caller_id,
|
||||
'response' => $response,
|
||||
]);
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()], 422);
|
||||
}
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
// return $order->product_json['customersetting'];
|
||||
// return $order->product_json;
|
||||
// اطمینان از اینکه pay_at مقدار دارد
|
||||
|
|
@ -300,7 +277,7 @@ class OrderController extends Controller
|
|||
try {
|
||||
Http::withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
])->post($trigerUrl.'/prc/api/trigger-update', [
|
||||
])->post($trigerUrl . '/prc/api/trigger-update', [
|
||||
'customer_id' => $order->customer_id,
|
||||
'order_id' => $order->id,
|
||||
'trigger' => 'send_order_sts',
|
||||
|
|
@ -313,7 +290,9 @@ class OrderController extends Controller
|
|||
$orderCustomer = Customer::with(['package'])->where('id', $order->customer_id)->first();
|
||||
|
||||
$DoNewSanadBuySaleGOLD = [];
|
||||
$desInFinance = $product->title." ".$order->description;
|
||||
$desInFinance = $product->title . " " . $order->description;
|
||||
$nextDay = $date->addDays($product->days_after);
|
||||
$zamanTasvie = sprintf('%02d-%02d-%02d', $nextDay->getYear(),$nextDay->getMonth(),$nextDay->getDay(), );
|
||||
$DoNewSanadBuySaleGOLD[] = [
|
||||
1, // Sabte_Kol_Or_Movaghat_1_0 (assuming type 1 is main)
|
||||
$orderCustomer->tahesab_id, // Moshtari_Code
|
||||
|
|
@ -331,33 +310,38 @@ class OrderController extends Controller
|
|||
0, // MazanehIsMesghalOrGeram_0_1
|
||||
1, // IsMotefaregheOrAbshode_0_1
|
||||
$order->payment_amount, // MablaghKol
|
||||
$desInFinance, // description
|
||||
$desInFinance, // description, // Sharh
|
||||
55, // Code_Factor
|
||||
null, // HavalehBe_Mcode
|
||||
0, // MultiRadif
|
||||
0, // Jens_Felez
|
||||
$zamanTasvie, // Zaman_Tasvie (یک روز بعد)
|
||||
];
|
||||
|
||||
$DoNewSanadBuySaleGOLD;
|
||||
$response = [];
|
||||
if ($order->sts == 2){
|
||||
if ($order->sts == 2) {
|
||||
try {
|
||||
Http::withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
])->post($trigerUrl.'/prc/api/trigger-update', [
|
||||
])->post($trigerUrl . '/prc/api/trigger-update', [
|
||||
'trigger' => 'get_balens',
|
||||
]);
|
||||
} catch (\Exception $exception) {
|
||||
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
try {
|
||||
Http::withHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
])->post($trigerUrl.'/prc/api/trigger-update', [
|
||||
])->post($trigerUrl . '/prc/api/trigger-update', [
|
||||
'trigger' => 'reject_order',
|
||||
]);
|
||||
} catch (\Exception $exception) {
|
||||
|
||||
}
|
||||
}
|
||||
if ($this->Config('tahesab') == "send_importent"&&
|
||||
if ($this->Config('tahesab') == "send_importent" &&
|
||||
$_SERVER['HTTP_HOST'] != 'marandiigold.ir') {
|
||||
if ($order->sts == 2) {
|
||||
|
||||
|
|
@ -371,7 +355,7 @@ class OrderController extends Controller
|
|||
$shamsiYear, // Shamsi_Year
|
||||
$shamsiMonth, // Shamsi_Month
|
||||
$shamsiDay, // Shamsi_Day
|
||||
$order->product->amount * $order->amount, // Weight in grams
|
||||
$order->product->amount, // Weight in grams
|
||||
750, // 18k gold (750)
|
||||
$order->amount, // 2 coins
|
||||
$order->product->title, // Coin name (Bahar Azadi)
|
||||
|
|
@ -398,23 +382,23 @@ class OrderController extends Controller
|
|||
])->json();
|
||||
}
|
||||
}
|
||||
if (!isset( $mainResponce['OK'])){
|
||||
if (!isset($mainResponce['OK'])) {
|
||||
return response()->json(['message' => "مشکل در اتصال به حسابداری"], 422);
|
||||
|
||||
}
|
||||
foreach ($order->product_json['customersetting'] as $customerSetting) {
|
||||
if (isset($customerSetting['agent_id'])) {
|
||||
$customerSettingData['for'] =Customer::find($customerSetting['agent_id']);
|
||||
$customerSettingData['for'] = Customer::find($customerSetting['agent_id']);
|
||||
$customerSettingData['profit'] = $order->amount;
|
||||
$customerSettingData['customerSettingPro'] = $order->product_json;
|
||||
$customerSettingData['profitM'] = ($order->product_json['unit'] == "گرم")? $order->amount/4.3318:$order->amount;
|
||||
$customerSettingData['profitM'] = ($order->product_json['unit'] == "گرم") ? $order->amount / 4.3318 : $order->amount;
|
||||
$customerSettingData['customerSetting'] = $customerSetting;
|
||||
$customerSettingData['profitM'] = $customerSettingData['profitM']*$customerSetting['profit_buy'];
|
||||
$customerSettingData['profitM'] = $customerSettingData['profitM'] * $customerSetting['profit_buy'];
|
||||
$randomString = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 25)), 0, 25);
|
||||
$messageForProfit = "بابت معامله {$orderCustomer['name']}، ";
|
||||
$messageForProfit .= "به مقدار " ;
|
||||
$messageForProfit .= ($order->input_mode == "gold") ? $order->amount:$order->price_original;
|
||||
$messageForProfit .= ($order->input_mode == "gold") ? " گرم " :" ریال ";
|
||||
$messageForProfit .= "به مقدار ";
|
||||
$messageForProfit .= ($order->input_mode == "gold") ? $order->amount : $order->price_original;
|
||||
$messageForProfit .= ($order->input_mode == "gold") ? " گرم " : " ریال ";
|
||||
$messageForProfit .= "در مظنه ";
|
||||
$messageForProfit .= number_format($customerSettingData['customerSettingPro']['sub_agent']['rate_buy_price']);
|
||||
$messageForProfit .= " سود ";
|
||||
|
|
@ -433,7 +417,7 @@ class OrderController extends Controller
|
|||
$shamsiMonth, // Shamsi_Month
|
||||
$shamsiDay, // Shamsi_Day
|
||||
0, // Vazn
|
||||
$customerSettingData['profitM'] ,
|
||||
$customerSettingData['profitM'],
|
||||
// بابت معامله علی منتظر عدد ریال/گرم در مظنه فلان (10000)
|
||||
$messageForProfit,
|
||||
"پورسانت معامله", // بابت
|
||||
|
|
@ -465,11 +449,11 @@ class OrderController extends Controller
|
|||
|
||||
$this->sendMessage(trim($orderCustomer->mobile), $message);
|
||||
$pushNotif = new PushController();
|
||||
$pushNotif->sendWebPush([$orderCustomer->id],[
|
||||
$pushNotif->sendWebPush([$orderCustomer->id], [
|
||||
'title' => 'تغییر وضعیت سفارش',
|
||||
'body' => $message,
|
||||
'icon' => null,
|
||||
'data' => ['url'=>'property']
|
||||
'data' => ['url' => 'property']
|
||||
]);
|
||||
|
||||
|
||||
|
|
@ -508,100 +492,6 @@ class OrderController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if ($_SERVER['HTTP_HOST'] == 'zarsun.gold' or $_SERVER['HTTP_HOST'] == 'liman.gold' ){
|
||||
$productPage = Http::withHeaders([
|
||||
'accept' => 'application/json, text/plain, */*',
|
||||
'accept-language' => 'en-US,en;q=0.9,fa;q=0.8',
|
||||
'authorization' => 'Bearer wDUK4wQMvBLymXKzJetIbqqfC5zha3u20Djlu6SCxz1pleKmoAFLks5pfokH6VSQwrMyMytcr6zHnp5v5Gj1VxyD9sY794ujWPKhWE252uLSQJaFPUnBMN-b5jVUGPcoM5mb07F-Fs0uclTMW41gkeh5sH6WDbDi0siF0nFxG0zOkPtenNO0-QCvnoXjV5x4nJ-0Gw9M4SPFskLmgjgJ0i2Y4W9pWErEVDDOVw3CzfbcpUTyANgwp0-MdVbJsKixBNfb2DWZsSgbORxrpcvtvCs5M-dTe31NQ2WyRwI-SsEIvHVryVZLOq_VU2YFu7n1plPb20L09Q2oMvtStx0uLiPSH7ieGHZuHYFLw5n6XCB6NBpLnmcPOEzLRuPMH9IMuGThGJ2bdg3LkBoMafULZR0jepiq4myb1BMnaWCkd5CeLEIB_6y4pjdzWkLKZMW2fFYk6IQ1Xkbo56zCU-MT7ThqD-t7BTgo-DALnQspHMUROtIGEknwK6GFQ74ddmuBLSKLhefdoPuKb8JPkD17oQNlh8J2BFcrQCezqXgzziOSqOTkmad2gzSLg4CSM-Cz1thgsgMtTrpcVH_dK7KvXOWi3cvtVnWiaIoo0gzQkkCxwen5QNjeJnDc0e2jvMhKelHaL4O09JTdysUgBYLi9PJ72Ued00wfkMGhgs294EnUlgnY5FbxiKB5H9qF7E_1aXje8uasUt2vHk_OSKVFwjmZ4rl5NnUj6VUf97nWA8z6QS8c5uHzGqxs9kjFYWfb16xqNkk_xWQ_ABXiZxf-KE_bDiSCJ53tLiGni7xF9jQwee9ZTCmTenRxMlrYL_rp5vxSJt8x0pBkkHPMSQllkS_GGbSMBoYy4TGeTFB0sC2a9NETVvAJayrOJlW7IZgNQGVl9ezkaEq_56CndiRnB9lSjKAhM9v63HhbB6AuvwLR_GRn',
|
||||
'content-type' => 'application/json;charset=UTF-8',
|
||||
'origin' => 'https://pnl.arianatala.com',
|
||||
'roletype' => '0',
|
||||
'shopkeeperid' => 'b7ad9754-b338-ed11-bc91-00505600c58c',
|
||||
'subcode' => '0',
|
||||
'user-agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1',
|
||||
'webappversion' => '5.10.19',
|
||||
])->post('https://pnlapi.arianatala.com/api/Home/GetDealView', [
|
||||
"itemId" => 1,
|
||||
"shopkeeperId" => "b7ad9754-b338-ed11-bc91-00505600c58c",
|
||||
"dealType" => $order->direction == 1 ? 1 : 0,
|
||||
])->json();
|
||||
$responseSubmitDeal = Http::withHeaders([
|
||||
'accept' => 'application/json, text/plain, */*',
|
||||
'accept-language' => 'en-US,en;q=0.9,fa;q=0.8',
|
||||
'authorization' => 'Bearer wDUK4wQMvBLymXKzJetIbqqfC5zha3u20Djlu6SCxz1pleKmoAFLks5pfokH6VSQwrMyMytcr6zHnp5v5Gj1VxyD9sY794ujWPKhWE252uLSQJaFPUnBMN-b5jVUGPcoM5mb07F-Fs0uclTMW41gkeh5sH6WDbDi0siF0nFxG0zOkPtenNO0-QCvnoXjV5x4nJ-0Gw9M4SPFskLmgjgJ0i2Y4W9pWErEVDDOVw3CzfbcpUTyANgwp0-MdVbJsKixBNfb2DWZsSgbORxrpcvtvCs5M-dTe31NQ2WyRwI-SsEIvHVryVZLOq_VU2YFu7n1plPb20L09Q2oMvtStx0uLiPSH7ieGHZuHYFLw5n6XCB6NBpLnmcPOEzLRuPMH9IMuGThGJ2bdg3LkBoMafULZR0jepiq4myb1BMnaWCkd5CeLEIB_6y4pjdzWkLKZMW2fFYk6IQ1Xkbo56zCU-MT7ThqD-t7BTgo-DALnQspHMUROtIGEknwK6GFQ74ddmuBLSKLhefdoPuKb8JPkD17oQNlh8J2BFcrQCezqXgzziOSqOTkmad2gzSLg4CSM-Cz1thgsgMtTrpcVH_dK7KvXOWi3cvtVnWiaIoo0gzQkkCxwen5QNjeJnDc0e2jvMhKelHaL4O09JTdysUgBYLi9PJ72Ued00wfkMGhgs294EnUlgnY5FbxiKB5H9qF7E_1aXje8uasUt2vHk_OSKVFwjmZ4rl5NnUj6VUf97nWA8z6QS8c5uHzGqxs9kjFYWfb16xqNkk_xWQ_ABXiZxf-KE_bDiSCJ53tLiGni7xF9jQwee9ZTCmTenRxMlrYL_rp5vxSJt8x0pBkkHPMSQllkS_GGbSMBoYy4TGeTFB0sC2a9NETVvAJayrOJlW7IZgNQGVl9ezkaEq_56CndiRnB9lSjKAhM9v63HhbB6AuvwLR_GRn',
|
||||
'content-type' => 'application/json;charset=UTF-8',
|
||||
'origin' => 'https://pnl.arianatala.com',
|
||||
'roletype' => '0',
|
||||
'shopkeeperid' => 'b7ad9754-b338-ed11-bc91-00505600c58c',
|
||||
'subcode' => '0',
|
||||
'user-agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1',
|
||||
'webappversion' => '5.10.19',
|
||||
])->post('https://pnlapi.arianatala.com/api/Home/SubmitDeal', [
|
||||
"Id" => 1,
|
||||
"ClientOrderId" => $productPage['Data']['ClientOrderId'],
|
||||
"ShopName" => "آریانا",
|
||||
"ShopkeeperId" => "b7ad9754-b338-ed11-bc91-00505600c58c",
|
||||
"Name" => "آبشده نقد فردا",
|
||||
"Unit" => "گرم",
|
||||
"GoldEquivalent" => 0,
|
||||
"Carat" => 750,
|
||||
"Image" => null,
|
||||
"DiscountPrice" =>round( $order->amount*($productPage['Data']['Price']/4.3318), -3),
|
||||
"AllowRange" => 0,
|
||||
"OrderHallAllowRange" => 0,
|
||||
"ItemType" => 1,
|
||||
"ItemGroupId" => 0,
|
||||
"ItemGroupName" => null,
|
||||
"IBuy" => false,
|
||||
"ISell" => false,
|
||||
"IsShow" => false,
|
||||
"CanDeal" => false,
|
||||
"IsOnline" => true,
|
||||
"ShowMazaneInCloseShop" => false,
|
||||
"GoldInventory" => 0,
|
||||
"Description" => "",
|
||||
"Discount" => 0,
|
||||
"Price" => round( $order->amount*($productPage['Data']['Price']/4.3318), -3),
|
||||
"MaxCount" => 3000,
|
||||
"MinCount" => 1,
|
||||
"RemainCount" => null,
|
||||
"CanDoOrderDeal" => true,
|
||||
"CanDoDeal" => true,
|
||||
"WaitTime" => 60,
|
||||
"CancelDealByCustomerWaitTime" => 0,
|
||||
"RoundType" => 0,
|
||||
"UpdatedTime" => null,
|
||||
"OrderIndex" => 0,
|
||||
"Credit" => null,
|
||||
"CreditStr" => "0",
|
||||
"OnlyShowForMazaneChannel" => false,
|
||||
"OrderDealAllowRange" => 90000,
|
||||
"OrderDealFromAllowRange" => 39740000,
|
||||
"OrderDealToAllowRange" => 39920000,
|
||||
"OrderTimes" => [
|
||||
["FactorTime" => 30,"Time" => 30,"TimeStr" => "تا 30 ثانیه آینده","TimeType" => 1],
|
||||
["FactorTime" => 1,"Time" => 60,"TimeStr" => "تا 1 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 5,"Time" => 300,"TimeStr" => "تا 5 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 10,"Time" => 600,"TimeStr" => "تا 10 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 15,"Time" => 900,"TimeStr" => "تا 15 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 20,"Time" => 1200,"TimeStr" => "تا 20 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 30,"Time" => 1800,"TimeStr" => "تا 30 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 40,"Time" => 2400,"TimeStr" => "تا 40 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 50,"Time" => 3000,"TimeStr" => "تا 50 دقیقه آینده","TimeType" => 60],
|
||||
["FactorTime" => 60,"Time" => 3600,"TimeStr" => "تا 60 دقیقه آینده","TimeType" => 60],
|
||||
],
|
||||
"MaxOrderDealExpireTime" => 120,
|
||||
"ItemName" => "آبشده نقد فردا",
|
||||
"ItemUnit" => "گرم",
|
||||
"ItemId" => 1,
|
||||
"Count" =>$order->amount, // dynamic from your order
|
||||
"IsOrderDeal" => false,
|
||||
"IsRecovery" => false,
|
||||
"OrderId" => "",
|
||||
"DealType" => $order->direction == 1 ? 0 :1, // dynamic buy/sell
|
||||
"Fee" => $productPage['Data']['Price'],
|
||||
])->json();
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'response' => $response,
|
||||
|
|
|
|||
|
|
@ -206,21 +206,13 @@ class Controller extends BaseController
|
|||
'secret_key' => 'f21debfb-83ac-4624-a2f4-f08375043181',
|
||||
])->post('https://sms.wolog.ir/api/createsms', [
|
||||
'phone' => $to,
|
||||
'host' => 'liman',
|
||||
'text' => trim($msg),
|
||||
]);
|
||||
|
||||
$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',
|
||||
]);
|
||||
|
||||
|
||||
// $message = SmsPrice($msg);
|
||||
|
||||
$platforms[] = "0098:{$to}";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,26 +18,52 @@ class CustomerController extends Controller
|
|||
$select = ['*',Customer::$SELECT_CAJ,Customer::$SELECT_TYPE_STR];
|
||||
$user = Customer::with(['package.parent','customer_settings.customer',"agent"])->select($select)->findOrFail(auth('customer')->id());
|
||||
$user->name = $user->gender . " ".$user->name;
|
||||
|
||||
|
||||
|
||||
if ($this->Config('finance') == "tahesab"){
|
||||
$response = Http::withoutVerifying()
|
||||
->withToken($this->Config('tahesab_token'))
|
||||
->withHeaders(['DBName' => $this->Config('tahesab_db')])
|
||||
->post($this->Config('tahesab_api'), [
|
||||
'getmandehesabbycode' => [$user->tahesab_id]
|
||||
])->json();
|
||||
$gold_balance =$response['MandeHesab'][0]['MandeyeVazni']??0;
|
||||
$rial_balance =$response['MandeHesab'][0]['MandeyeMali']??0 ;
|
||||
if ($gold_balance != $user->gold_balance or $rial_balance != $user->rial_balance) {
|
||||
$user->rial_balance = $rial_balance;
|
||||
$user->gold_balance = $gold_balance;
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
$m =$user->gold_balance ??0;
|
||||
if ($gold18 = $this->Config('credit_rial_to_gold_18')){
|
||||
$m += $user->rial_balance / $gold18;
|
||||
$credits['gold18'] =$gold18 ??0;
|
||||
}
|
||||
$credits['mandeh'] = $m ?? 0;
|
||||
$expression = str_replace('m', $m, $user->credit ?? $credits['mandeh']);
|
||||
if (preg_match('/^[0-9+\-*\/().\s]+$/', $expression)) {
|
||||
$credit = eval("return $expression;");
|
||||
} else {
|
||||
return response()->json($user);
|
||||
}
|
||||
$credits['credit'] = $credit ??0;
|
||||
$user->credits = $credits;
|
||||
|
||||
|
||||
return response()->json($user);
|
||||
}
|
||||
|
||||
public function creatAD(Request $request){
|
||||
return (new adm_cu())->store($request);
|
||||
}
|
||||
|
||||
|
||||
public function pdf(Request $request){
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
$startDate = $request->formattedStart ? Jalalian::forge($request->formattedStart)->format('Y-m-d') : Jalalian::forge(time())->subMonths(1)->format('Y-m-d');
|
||||
$endDate = $request->formattedEnd ? Jalalian::forge($request->formattedEnd)->format('Y-m-d') : Jalalian::forge(time())->format('Y-m-d');
|
||||
|
||||
|
||||
// Prepare payload for the API request
|
||||
$DoNewMoshtari = [
|
||||
2000000000, // Count_Last
|
||||
null, // Count_Last
|
||||
$user->tahesab_id, // Moshtari_Code
|
||||
$startDate, // AzTarikhShamsi
|
||||
$endDate, // TaTarikhShamsi
|
||||
|
|
@ -49,8 +75,13 @@ class CustomerController extends Controller
|
|||
'DoListAsnad' => $DoNewMoshtari
|
||||
])
|
||||
->json();
|
||||
// return response()->json($DoNewMoshtari,422);
|
||||
|
||||
if (isset($response['ERROR']) && $response['ERROR'] === "رکوردی یافت نشد.") {
|
||||
$start = Jalalian::fromFormat('Y-m-d', $startDate)->format('Y/m/d');
|
||||
$end = Jalalian::fromFormat('Y-m-d', $endDate)->format('Y/m/d');
|
||||
return response()->json([
|
||||
'message' => "در بازه $start تا $end سندی برای شما ثبت نشده است."
|
||||
], 422);
|
||||
}
|
||||
if (!is_array($response)) {
|
||||
$response = [$response];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ class OrderController extends Controller
|
|||
}
|
||||
|
||||
$data['customer_id'] = $user->id;
|
||||
$products = json_decode(app(CustomerProductController::class)->list_product($user->id)->getContent(), true);
|
||||
|
||||
$products = json_decode(app(CustomerProductController::class)->list_product($user->id)->getContent(), true);
|
||||
foreach ($products as $pro) {
|
||||
if ($pro['id'] == $data['product_id']) {
|
||||
$data['product'] = $product = $pro;
|
||||
|
|
@ -57,6 +57,43 @@ class OrderController extends Controller
|
|||
if (!$product['active']) {
|
||||
throw new UnprocessableEntityHttpException('در حال حاضر امکان ثبت سفارش وجود ندارد');
|
||||
}
|
||||
if($user->tahesab_id == 1001){
|
||||
if ($this->Config('finance') == "tahesab"){
|
||||
$response = Http::withoutVerifying()
|
||||
->withToken($this->Config('tahesab_token'))
|
||||
->withHeaders(['DBName' => $this->Config('tahesab_db')])
|
||||
->post($this->Config('tahesab_api'), [
|
||||
'getmandehesabbycode' => [$user->tahesab_id]
|
||||
])->json();
|
||||
$gold_balance =$response['MandeHesab'][0]['MandeyeVazni']??0;
|
||||
$rial_balance =$response['MandeHesab'][0]['MandeyeMali']??0 ;
|
||||
if ($gold_balance != $user->gold_balance or $rial_balance != $user->rial_balance) {
|
||||
$user->rial_balance = $rial_balance;
|
||||
$user->gold_balance = $gold_balance;
|
||||
$user->save();
|
||||
}
|
||||
}
|
||||
$m =$user->gold_balance;
|
||||
if ($gold18 = $this->Config('credit_rial_to_gold_18')){
|
||||
$m += $user->rial_balance / $gold18;
|
||||
}
|
||||
|
||||
$expression = str_replace('m', $m, $user->credit);
|
||||
|
||||
if (preg_match('/^[0-9+\-*\/().\s]+$/', $expression)) {
|
||||
$credit = eval("return $expression;");
|
||||
} else {
|
||||
return response()->json(['message'=> "مشکل در اعتبار."],422);
|
||||
}
|
||||
if (!($request->amount < $credit)){
|
||||
return response()->json(['message'=>($request->amount < $credit)?"اوکیه":"کمبود اعتبار",'data'=>["اعتبار"=>$credit,"ته حساب"=>"$m","وزن"=>"$request->amount",($request->amount < $credit)?"اوکیه":"کمبود اعتبار"]],422);
|
||||
|
||||
}
|
||||
return response()->json(['message'=>($request->amount < $credit)?"اوکیه":"کمبود اعتبار",'data'=>["اعتبار"=>$credit,"ته حساب"=>"$m","وزن"=>"$request->amount",($request->amount < $credit)?"اوکیه":"کمبود اعتبار"]],422);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($request['direction'] == 1) {
|
||||
|
|
@ -194,12 +231,12 @@ class OrderController extends Controller
|
|||
// $response['newData']=$data;
|
||||
// return $response ;
|
||||
// }
|
||||
$data['pay_at'] = Carbon::now()->addDays($product['days_after']);
|
||||
$data['pay_at'] = Carbon::now()->addDays(/*$product['days_after']*/ 0);
|
||||
|
||||
$order = Order::create($data);
|
||||
$order->product_json = $product;
|
||||
$order->save();
|
||||
$orderLimitation = 50;
|
||||
$orderLimitation = 5000000;
|
||||
if ($_SERVER['HTTP_HOST'] == 'marandiigold.ir') {
|
||||
$orderLimitation = 100;
|
||||
}
|
||||
|
|
@ -212,7 +249,9 @@ class OrderController extends Controller
|
|||
if ($product['auto_buy']) {
|
||||
$request = new Request([
|
||||
'order_id' => $order->id,
|
||||
'method' => "liman",
|
||||
'is_send_to_provider' => "ارینا گلد",
|
||||
'service_id' => $data['product']['service_id'],
|
||||
'service_pid' => $data['product']['service_pid'],
|
||||
'sts' => 2,
|
||||
]);
|
||||
$AdminOrderController = new AdminOrderController();
|
||||
|
|
@ -223,7 +262,9 @@ class OrderController extends Controller
|
|||
if ($product['auto_sell']) {
|
||||
$request = new Request([
|
||||
'order_id' => $order->id,
|
||||
'method' => "liman",
|
||||
'is_send_to_provider' => "ارینا گلد",
|
||||
'service_id' => $data['product']['service_id'],
|
||||
'service_pid' => $data['product']['service_pid'],
|
||||
'sts' => 2,
|
||||
]);
|
||||
$AdminOrderController = new AdminOrderController();
|
||||
|
|
@ -276,13 +317,13 @@ class OrderController extends Controller
|
|||
|
||||
//send Admin Notif
|
||||
$userIds = User::pluck('id')->toArray();
|
||||
$pushNotif = new PushController();
|
||||
$pushNotif->sendWebPush($userIds,[
|
||||
'title' => 'سفارش جدید',
|
||||
'body' => $adminsMessage,
|
||||
'icon' => null,
|
||||
'data' => ['url'=>'order']
|
||||
]);
|
||||
// $pushNotif = new PushController();
|
||||
// $pushNotif->sendWebPush($userIds,[
|
||||
// 'title' => 'سفارش جدید',
|
||||
// 'body' => $adminsMessage,
|
||||
// 'icon' => null,
|
||||
// 'data' => ['url'=>'order']
|
||||
// ]);
|
||||
|
||||
|
||||
return [$data, $order];
|
||||
|
|
@ -372,7 +413,6 @@ class OrderController extends Controller
|
|||
}
|
||||
$data['price_id'] = $PriceMain->id;
|
||||
$order = Order::create($data);
|
||||
//-----------------تاید اتوماتیک در کلهور
|
||||
|
||||
//--------messages
|
||||
$siteOrder = $order;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class TahesabController extends Controller
|
|||
|
||||
// Prepare payload for the API request
|
||||
$DoNewMoshtari = [
|
||||
2000000000, // Count_Last
|
||||
null, // Count_Last
|
||||
$user->tahesab_id, // Moshtari_Code
|
||||
$fromDate, // AzTarikhShamsi
|
||||
$toDate, // TaTarikhShamsi
|
||||
|
|
@ -195,7 +195,7 @@ class TahesabController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if (($_SERVER['HTTP_HOST'] === 'liman.gold') or($_SERVER['HTTP_HOST'] === 'marandiigold.ir') ) {
|
||||
if (($_SERVER['HTTP_HOST'] === 'marandiigold.ir') ) {
|
||||
$returnArray=[];
|
||||
$returnArray[0] = [
|
||||
"isKol" => true,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class Product extends Model
|
|||
'auto_open_at',
|
||||
'reading_method',
|
||||
'days_after',
|
||||
'service_pid',
|
||||
'service_id',
|
||||
'open_buy'
|
||||
];
|
||||
protected $casts = [
|
||||
|
|
|
|||
|
|
@ -221,27 +221,54 @@
|
|||
@foreach($send['data'] as $item)
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{$item['Tarikh'] ?? '--'}}</td>
|
||||
<td>{{$item['Sh_Factor'] ?? '--' }}</td>
|
||||
<td>{{$item['NO'] ?? '--' }}</td>
|
||||
<td>{{$item['Mazaneh'] ?? '-' }}</td>
|
||||
<td>{{$item['Vazn'] ?? '-' }}</td>
|
||||
<td>{{ is_numeric($item['Vazn'] ?? 0) && $item['Vazn'] > 0 ? floatval($item['Vazn']) : '--' }}</td>
|
||||
<td>{{ is_numeric($item['Vazn'] ?? 0) && $item['Vazn'] < 0 ? floatval(abs($item['Vazn'])) : '--' }}</td>
|
||||
{{-- <td>{{ is_numeric($item['TahesabVazni'] ?? 0) ? number_format($item['TahesabVazni']) : '--' }}</td>--}}
|
||||
<td>{{ empty($item['Tarikh']) || $item['Tarikh'] === 'null' ? '--' : $item['Tarikh'] }}</td>
|
||||
<td>{{ empty($item['Sh_Factor']) || $item['Sh_Factor'] === 'null' ? '--' : $item['Sh_Factor'] }}</td>
|
||||
<td>{{ empty($item['NO']) || $item['NO'] === 'null' ? '--' : $item['NO'] }}</td>
|
||||
<td>{{ empty($item['Mazaneh']) || $item['Mazaneh'] === 'null' ? '--' : $item['Mazaneh'] }}</td>
|
||||
<td>{{ empty($item['Vazn']) || $item['Vazn'] === 'null' ? '--' : $item['Vazn'] }}</td>
|
||||
|
||||
<td>{{ is_numeric($item['Vazn'] ?? 0) && floatval($item['Vazn']) > 0 ? floatval($item['Vazn']) : '--' }}</td>
|
||||
<td>{{ is_numeric($item['Vazn'] ?? 0) && floatval($item['Vazn']) < 0 ? floatval(abs($item['Vazn'])) : '--' }}</td>
|
||||
|
||||
<td>{{ is_numeric($item['TahesabVazni'] ?? 0) ? floatval($item['TahesabVazni']) : '--' }}</td>
|
||||
<td>{{ is_numeric($item['Mali'] ?? 0) && $item['Mali'] > 0 ? number_format($item['Mali']) : '--' }}</td>
|
||||
<td>{{ is_numeric($item['Mali'] ?? 0) && $item['Mali'] < 0 ? number_format(abs($item['Mali'])) : '--' }}</td>
|
||||
<td>{{ is_numeric($item['TahesabMali'] ?? 0) ? number_format($item['TahesabMali']) : '--' }}</td>
|
||||
<td>{{$item['Sharh1'] ?? '--' }}</td>
|
||||
|
||||
<td>{{ empty($item['Sharh1']) || $item['Sharh1'] === 'null' ? '--' : $item['Sharh1'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="11">No data available</td>
|
||||
<td colspan="13">No data available</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
{{-- @if(isset($send['data']) && (is_array($send['data']) || is_object($send['data'])))--}}
|
||||
{{-- @foreach($send['data'] as $item)--}}
|
||||
{{-- <tr>--}}
|
||||
{{-- <td>{{$loop->iteration}}</td>--}}
|
||||
{{-- <td>{{$item['Tarikh'] ?? '--'}}</td>--}}
|
||||
{{-- <td>{{$item['Sh_Factor'] ?? '--' }}</td>--}}
|
||||
{{-- <td>{{$item['NO'] ?? '--' }}</td>--}}
|
||||
{{-- <td>{{$item['Mazaneh'] ?? '-' }}</td>--}}
|
||||
{{-- <td>{{$item['Vazn'] ?? '-' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['Vazn'] ?? 0) && $item['Vazn'] > 0 ? floatval($item['Vazn']) : '--' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['Vazn'] ?? 0) && $item['Vazn'] < 0 ? floatval(abs($item['Vazn'])) : '--' }}</td>--}}
|
||||
{{-- --}}{{-- <td>{{ is_numeric($item['TahesabVazni'] ?? 0) ? number_format($item['TahesabVazni']) : '--' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['TahesabVazni'] ?? 0) ? floatval($item['TahesabVazni']) : '--' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['Mali'] ?? 0) && $item['Mali'] > 0 ? number_format($item['Mali']) : '--' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['Mali'] ?? 0) && $item['Mali'] < 0 ? number_format(abs($item['Mali'])) : '--' }}</td>--}}
|
||||
{{-- <td>{{ is_numeric($item['TahesabMali'] ?? 0) ? number_format($item['TahesabMali']) : '--' }}</td>--}}
|
||||
{{-- <td>{{$item['Sharh1'] ?? '--' }}</td>--}}
|
||||
{{-- </tr>--}}
|
||||
{{-- @endforeach--}}
|
||||
{{-- @else--}}
|
||||
{{-- <tr>--}}
|
||||
{{-- <td colspan="11">No data available</td>--}}
|
||||
{{-- </tr>--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ Route::get('b750e',[PriceController::class, 'b750e']);
|
|||
Route::post('deposit_id',[PayPingController::class, 'deposit_id']);
|
||||
Route::get('/order/tableS',[OrderController::class, 'tableS']);
|
||||
Route::post('/order/verifyS',[OrderController::class, 'verifyS']);
|
||||
Route::post('/praska',[OrderController::class, 'praskaVerifyS']);
|
||||
Route::post('/customer_all/is_get_customer', function () {
|
||||
setcookie("is_get_customer", "1", time() - (30 * 60), "/");return response()->json([true]);});
|
||||
|
||||
|
|
@ -43,11 +44,38 @@ Route::post('push/subscribe', [PushController::class, 'subscribe']);
|
|||
//Route::post('push/unsubscribe', [PushController::class, 'unsubscribe']);
|
||||
//Route::get('notifications/unread', function(Request $r) { return $r->user()->unreadNotifications; });
|
||||
//Route::post('notifications/{id}/mark-read', function($id, Request $r){ $r->user()->notifications()->where('id',$id)->update(['read_at'=>now()]); return ['ok'=>true]; });
|
||||
Route::get('/services_list', function (Request $request) {
|
||||
try {
|
||||
$response = Http::withHeaders([
|
||||
'user_secret' => '6d00035f2fe30f45029bd8e35711284336431781c1bdca54fdd8c1bd29fcd167',
|
||||
'origin' => $_SERVER['SERVER_NAME'],
|
||||
])->get('https://nerkh.gold/services/api')->json();
|
||||
}catch (Exception $exception){}
|
||||
|
||||
return $response;
|
||||
return [
|
||||
["id"=>"arianatala","name"=>"ارینا گلد"],
|
||||
["id"=>"mokagold","name"=>"موکا گلد"]];
|
||||
|
||||
});
|
||||
Route::middleware('auth:user')->group(function (){
|
||||
Route::middleware('validation')->group(function (){
|
||||
|
||||
|
||||
//
|
||||
// Route::get('/services_list', function (Request $request) {
|
||||
// try {
|
||||
// $response = Http::withHeaders([
|
||||
// 'user_secret' => '6d00035f2fe30f45029bd8e35711284336431781c1bd8354fdd8c1bd83fcd167',
|
||||
// 'origin' => $_SERVER['SERVER_NAME'],
|
||||
// ])->get('https://nerkh.gold/services/api');
|
||||
// }catch (Exception $exception){}
|
||||
//
|
||||
// return $response;
|
||||
// return [
|
||||
// ["id"=>"arianatala","name"=>"ارینا گلد"],
|
||||
// ["id"=>"mokagold","name"=>"موکا گلد"]];
|
||||
//
|
||||
// })
|
||||
// ;
|
||||
Route::get('create_link_pricing',[PriceController::class, 'createLinkPricing']);
|
||||
Route::post('/group/cradit', function () {
|
||||
return response()->json([true]);
|
||||
|
|
|
|||
|
|
@ -33,9 +33,73 @@ use Carbon\Carbon;
|
|||
// sudo nohup php artisan praska refPrice > refprice.log 2>&1 &
|
||||
|
||||
Route::any('/refPricer',[PriceController::class,'b750']);
|
||||
Route::get('/1212121hesabs', function () {
|
||||
return 11;
|
||||
|
||||
Route::get('/refPricertsttttordt', function () {
|
||||
// try {
|
||||
// } catch (\Exception $e) {
|
||||
// // اگر هنوز هم تاریخ معتبر نیست، fallback به created_at
|
||||
// $date = Jalalian::fromCarbon($order['created_at']);
|
||||
// }
|
||||
$date = Jalalian::fromCarbon(Carbon::now());
|
||||
|
||||
$shamsiYear = $date->getYear();
|
||||
$shamsiMonth = $date->getMonth();
|
||||
$shamsiDay = $date->getDay();
|
||||
$nextDay = $date->addDays(600);
|
||||
$zamanTasvie = sprintf('%02d-%02d-%02d', $nextDay->getYear(),$nextDay->getMonth(),$nextDay->getDay(), );
|
||||
|
||||
$DoNewSanadBuySaleGOLD[] = [
|
||||
1, // Sabte_Kol_Or_Movaghat_1_0
|
||||
1001, // Moshtari_Code
|
||||
55, // Factor_Number
|
||||
1, // Radif_Number
|
||||
$shamsiYear, // Shamsi_Year
|
||||
$shamsiMonth, // Shamsi_Month
|
||||
$shamsiDay, // Shamsi_Day
|
||||
(float)0.005, // Vazn
|
||||
750, // Ayar
|
||||
0, // Ang_Number
|
||||
'', // Name_az
|
||||
1, // BuyOrSale_0_1
|
||||
10, // Mazaneh
|
||||
0, // MazanehIsMesghalOrGeram_0_1
|
||||
1, // IsMotefaregheOrAbshode_0_1
|
||||
2000000, // MablaghKol
|
||||
'خرید طلای آبشده تستی', // Sharh
|
||||
55, // Code_Factor
|
||||
null, // HavalehBe_Mcode
|
||||
0, // MultiRadif
|
||||
0, // Jens_Felez
|
||||
$zamanTasvie, // Zaman_Tasvie (یک روز بعد)
|
||||
];
|
||||
$DoNewSanadBuySaleGOLD[] = [
|
||||
1, // Sabte_Kol_Or_Movaghat_1_0
|
||||
1001, // Moshtari_Code
|
||||
55, // Factor_Number
|
||||
1, // Radif_Number
|
||||
$shamsiYear, // Shamsi_Year
|
||||
$shamsiMonth, // Shamsi_Month
|
||||
$shamsiDay, // Shamsi_Day
|
||||
(float)0.005, // Vazn
|
||||
750, // Ayar
|
||||
0, // Ang_Number
|
||||
'', // Name_az
|
||||
1, // BuyOrSale_0_1
|
||||
10, // Mazaneh
|
||||
0, // MazanehIsMesghalOrGeram_0_1
|
||||
1, // IsMotefaregheOrAbshode_0_1
|
||||
2000000, // MablaghKol
|
||||
'خرید طلای آبشده تستی'
|
||||
];
|
||||
foreach ($DoNewSanadBuySaleGOLD as $DoNewSanadBuySaleGOLDRow) {
|
||||
$response[] = $mainResponce = Http::withoutVerifying()
|
||||
->withHeaders(['DBName' => "tahesabDB1"])
|
||||
->withToken("S3F1P8Q4W7X5F7P5B5V5W2D3U3M1N2C5N6E3W6M1E4X4V2Y1Q3O2L6W5W3G2B8T4U2V1S1W4A4S5A1U8")
|
||||
->post("https://31.7.68.147:3030/", [
|
||||
'getmandehesabbycode' => [11]
|
||||
])->json();
|
||||
}
|
||||
return[$DoNewSanadBuySaleGOLD, $response];
|
||||
});
|
||||
Route::get('/sendToProvider', function () {
|
||||
$productPage = Http::withHeaders(config('mokagold.ariyana.headers'))->withCookies(config('mokagold.ariyana.cookies'), 'arianatala.com')
|
||||
|
|
|
|||
Loading…
Reference in New Issue