/
proc
/
thread-self
/
root
/
home
/
henzagold
/
server
/
routes
/
File Upload :
llllll
Current File: //proc/thread-self/root/home/henzagold/server/routes/web.php
<?php use App\Http\Controllers\api\CustomerController; use App\Models\ConfigStatic; use App\Models\Customer; use App\Models\Link; use App\Models\ProductVariant; use App\Models\Sms; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Http; use Morilog\Jalali\Jalalian; /* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */ Route::match(['get', 'post'], '/fin_tahesab/table', [\App\Http\Controllers\Customer\TahesabController::class, 'index']); Route::get('/fin_tahesab/detail/{id}',[\App\Http\Controllers\Customer\TahesabController::class, 'detail']); Route::get('/fin_tahesab/my_detail/{offset}',[\App\Http\Controllers\Customer\TahesabController::class, 'my_detail']); Route::get('/fin_tahesab/mandeh',[\App\Http\Controllers\Customer\TahesabController::class, 'mandeh']); Route::get('/', function () { try { $responses[8] = Http::withoutVerifying()->timeout(1)->get("https://call3.tgju.org/ajax.json")->json(); } catch (\Exception $ex) { self::sendErrorToTelegram($ex); } if (isset($responses[8])) { $translations = [ "geram18" => "گرم ۱۸", "silver_999" => "نقره", "mesghal" => "مثقال", "price_dollar_rl"=> "دلار (ریال)", "sekeb" => "سکه تمام", "rob" => "ربع سکه", "nim" => "نیم سکه", "sekee_down" => "سکه طرح قدیم", "rob_down" => "ربع سکه طرح قدیم", "nim_down" => "نیم سکه طرح قدیم", ]; foreach ($responses[8]['current'] as $key => $value) { if (array_key_exists($key, $translations)) { $value['title'] = $translations[$key]; $allItems[$key] = $value; } } } ConfigStatic::where('key','gold_price_pwa')->update(['val' => $allItems]); ConfigStatic::where('key','gold_price')->update(['val' => $allItems]); return $allItems; // گرم // مثقال دلار سکه ها $tala_ir = (int)str_replace(',', '', Http::timeout(2)->get('https://www.tala.ir/ajax/price')->json()['gold']['gold_18k']['v']) * 10; if (!is_null($tala_ir)) { $service['uaj'] = Jalalian::forge(now())->format('Y/m/d - H:i:s'); // // // فیلتر کردن دادهها // $filtered = Arr::except($service, [7,8,9,10,20,21,22,23,24,25,26,27,28,29]); // تعریف آرایه با دادههای جدید $filtered['mesghal'] = [ "title" => "مثقاع طلا", "slug" => "mesghal", "p" => "206,460,000", "d" => "0", "dp" => "0.0000", "dt" => "", "h" => "206,460,000", "l" => "202,910,000", "t" => "1403-09-21 12:00:00", "updated_at" => "2024-10-10 20:11:12", "uaj" => "1403/09/25 - 12:13" ]; $filtered['geram18'] = [ "title" => "طلای 18 عیار", "slug" => "geram18", "p" => number_format($tala_ir), "d" => "0", "dp" => "0.0000", "dt" => "", "h" => number_format($tala_ir), "l" => number_format($tala_ir), "t" => $service['uaj'], "updated_at" => "2024-10-10 20:11:03", "uaj" => $service['uaj'] ]; $filtered['geram24'] = [ "title" => "طلای 24 عیار", "slug" => "geram24", "p" => "63,542,200", "d" => "0", "dp" => "0.0000", "dt" => "", "h" => "63,542,200", "l" => "62,449,600", "t" => "1403-09-21 12:00:00", "updated_at" => "2024-10-10 20:11:03", "uaj" => "1403/09/25 - 12:12" ]; // dd($filtered); // اینجا را میتوانید حذف کنید پس از بررسی // بهروزرسانی مقدار در پایگاه داده ConfigStatic::where('key','gold_price_pwa')->update(['val' => $filtered]); ConfigStatic::where('key', 'gold_price')->update(['val' => json_encode($filtered)]); return ConfigStatic::where('key','gold_price')->get(); } return "hi"; }); Route::get('/login', function () { Link::set('https://henzagold.com/app'); return redirect()->to('https://henzagold.com/app'); }); Route::get('/download', function () { Link::set('https://henzagold.com/download/henza.apk'); return redirect()->to('https://henzagold.com/download/henza.apk'); }); Route::get('/totalify', function () { $query = \App\Models\Collect::select(['collection_id_id' , 'product_id_id'])->get()->toArray(); $q = []; foreach ($query as $item) { if(!isset($q[$item['collection_id_id']])){ $q[$item['collection_id_id']] = 0; } $q[$item['collection_id_id']] += 1; } dd($q); foreach ($q as $item=>$total) { \App\Models\Category::where(['id'=>$item])->update(['total'=>$total]); } return true; }); /*Route::get('/readsms',[\App\Http\Controllers\Adm\AdminController::class , 'readSMS']);*/ Route::get('/confirem/order',[\App\Http\Controllers\Adm\AdminController::class , 'confiremOrder']); Route::get('/test2',function () { /* $message = 'علی قسامی'.' '."عزیز"."\n". "3 روز تا تخفیف های هیجان انگیز جمعه سیاه..."."\n". "تامینت رو به ما بسپار!"."\n". "اپلیکیشن طلای هنزا"; Sms::Send('09135517425' ,$message); return ;*/ $customers=Customer::get(); $customers->each(function ($item) { $message = $item->name.' '."عزیز"."\n". "3 روز تا تخفیف های هیجان انگیز جمعه سیاه..."."\n". "تامینت رو به ما بسپار!"."\n". "اپلیکیشن طلای هنزا"; Sms::Send($item->mobile ,$message); }); //Sms::Send('09128081392' ,$message); return true; //return true; /*$cutomer = Customer::all(); foreach ($cutomer as $item) { { CustomerController::updateRemain($item['id']); } }*/ }); //Site Api /*Route::get('config/menu' , [\App\Http\Controllers\Api\SiteController::class , 'getMenu']); Route::get('site/get-config' , [\App\Http\Controllers\Api\SiteController::class , 'getConfig']); Route::get('get-product' , [\App\Http\Controllers\Api\SiteController::class , 'getProduct']); Route::get('search' , [\App\Http\Controllers\Api\SiteController::class , 'searchProduct']); Route::get('products' , [\App\Http\Controllers\Api\SiteController::class , 'Products']);*/
Copyright ©2k19 -
Hexid
|
Tex7ure