<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-06-18 09:19:04
 namespace App\Http\Controllers; use App\OrderDetail; use App\Product; use App\Laravue\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Http\Resources\OrderResource; use App\Order; use Validator; use DB; class OrderController extends Controller { const ITEM_PER_PAGE = 20; private $_user; public function __construct() { $this->_user = auth("\x61\x70\151")->user(); } public function index(Request $request) { goto qxKxd; erSe9: $y3Byz = str_replace("\x23", '', $y3Byz); $X9A9s = DB::table("\157\x72\x64\x65\162\x73")->join("\x6f\x72\x64\145\162\x5f\x64\x65\x74\x61\x69\x6c\163", "\x6f\x72\144\x65\x72\x73\56\151\x64", "\75", "\x6f\162\x64\x65\162\137\x64\145\x74\x61\x69\154\163\x2e\157\x72\144\x65\162\137\x69\144")->select("\x6f\x72\144\145\162\x73\56\x69\x64\x20\141\x73\x20\x6f\162\144\145\x72\137\151\144", "\157\x72\x64\x65\x72\x5f\x64\145\164\141\151\154\x73\x2e\x70\x72\x6f\144\165\x63\164\137\156\x61\x6d\x65")->where("\x6f\162\x64\x65\162\x5f\144\x65\x74\141\x69\x6c\x73\56\160\x72\x6f\x64\165\143\x74\x5f\156\x61\155\145", "\114\111\113\105", "\45" . $y3Byz . "\45")->pluck("\x6f\x72\x64\x65\162\137\151\x64")->toArray(); $o3zkB->where(function ($ESsnJ) use($y3Byz, $X9A9s) { $ESsnJ->where("\143\x6f\x64\x65", "\x4c\111\113\105", "\45" . $y3Byz . "\x25")->orWhereIn("\x69\144", $X9A9s); }); goto IBTSA; IBTSA: GwprQ: $o3zkB->orderBy("\x75\x70\x64\x61\x74\x65\x64\x5f\x61\164", "\104\x45\123\103"); return OrderResource::collection($o3zkB->paginate($H63d9)); goto Ym4mm; WjteV: $o3zkB->where("\163\x74\x61\164\x75\163", $KToFL); lvLoz: if (!($y3Byz != null && $y3Byz != '')) { goto GwprQ; } goto erSe9; nXgre: $KToFL = Arr::get($rsu0o, "\163\164\141\x74\165\163", ''); $y3Byz = Arr::get($rsu0o, "\153\x65\171\x77\157\162\144", ''); if (!($KToFL != null && $KToFL != '')) { goto lvLoz; } goto WjteV; qxKxd: $rsu0o = $request->all(); $o3zkB = Order::where("\x69\163\x5f\x64\x65\154\x65\x74\145\144", false)->where("\x75\x73\145\162\137\x69\x64", $this->_user->id); $H63d9 = Arr::get($rsu0o, "\x6c\x69\x6d\x69\x74", static::ITEM_PER_PAGE); goto nXgre; Ym4mm: } public function show($JeSRy = 0) { $KS2_Q = Order::where("\x69\163\x5f\144\x65\154\145\x74\x65\144", false)->where("\x75\x73\x65\162\137\151\144", $this->_user->id)->where("\151\x64", $JeSRy)->first(); if (isset($KS2_Q)) { goto kaNRV; } return response()->json(["\145\x72\x72\x6f\162\x73" => "\117\x72\x64\x65\162\40\x69\x73\x20\x6e\x6f\x74\40\166\141\154\151\x64"], 403); kaNRV: return new OrderResource($KS2_Q); } public function store(Request $request) { return response()->json(null, 204); } public function update(Request $request, $JeSRy = 0) { goto Zlsed; k1nhw: I_tTp: $KS2_Q = Order::where("\x69\163\137\x64\x65\154\145\x74\x65\x64", false)->where("\x75\x73\145\x72\x5f\x69\144", $this->_user->id)->where("\x69\x64", $JeSRy)->first(); if (isset($KS2_Q)) { goto ZjiOx; } goto PNKIj; DoTAk: $KS2_Q->update(["\x73\164\x61\164\x75\x73" => $params["\163\164\x61\164\x75\x73"], "\x75\x70\144\x61\164\145\x64\137\x61\164" => date("\x59\55\x6d\55\144\40\110\x3a\x69\72\x73")]); if (!($params["\x73\x74\141\164\165\x73"] == 4 || $params["\163\x74\x61\x74\165\163"] == "\x34")) { goto NktOj; } $SEd2b = 0; goto L0XNj; Zlsed: $Ia7TQ = Validator::make($request->all(), ["\163\164\x61\x74\165\x73" => ["\x72\x65\161\x75\x69\x72\145\x64"]]); if (!$Ia7TQ->fails()) { goto I_tTp; } return response()->json(["\145\x72\x72\157\162\163" => $Ia7TQ->errors()], 403); goto k1nhw; Fpn4B: $oVar0 = ceil($SEd2b / $HrPQw); $oVar0 += $this->_user->point; User::where("\151\144", $this->_user->id)->update(["\x70\x6f\151\x6e\164" => $oVar0]); goto WZ06s; PNKIj: return response()->json(["\x65\162\162\157\x72\163" => "\x4f\x72\x64\145\x72\40\x69\163\40\x6e\157\x74\x20\166\141\154\151\144"], 403); ZjiOx: $params = $request->all(); goto DoTAk; L0XNj: foreach ($KS2_Q->order_detail as $V2yVF) { $SEd2b = $V2yVF->price + $V2yVF->tax; tl2PQ: } xZ_9D: $HrPQw = isset($this->_user->group) ? $this->_user->group->point_rate : 1000; goto Fpn4B; WZ06s: NktOj: return response()->json(null, 204); goto AmqEd; AmqEd: } public function destroy($JeSRy = 0) { $KS2_Q = Order::where("\151\x73\x5f\144\145\x6c\145\164\x65\x64", false)->where("\165\x73\x65\x72\137\151\144", $this->_user->id)->where("\151\x64", $JeSRy)->first(); if (isset($KS2_Q)) { goto WjcQ0; } response()->json(["\145\x72\x72\157\x72" => "\x43\x61\x6e\40\x6e\157\x74\40\144\145\x6c\145\164\145\x20\164\x68\x69\x73\40\x61\x64\144\x72\145\x73\x73"], 403); WjcQ0: try { $KS2_Q->update(["\x69\x73\x5f\x64\x65\x6c\x65\x74\145\144" => true]); } catch (\Exception $JZjXg) { response()->json(["\x65\x72\162\x6f\x72" => $JZjXg->getMessage()], 403); } return response()->json(null, 204); } }