<?php
//Obfuscated by YAK Pro - Php Obfuscator 2.0.13 at 2025-05-27 11:01:56
 namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\User; use Illuminate\Http\Request; use Illuminate\Support\Arr; use App\Order; use App\Http\Resources\Admin\OrderResource; use Validator; class OrderController extends Controller { const ITEM_PER_PAGE = 100; public function index(Request $request) { goto xZbT9; NsE9D: $n3v4k = str_replace("\43", '', $n3v4k); $KE3Ld->where("\x63\x6f\144\145", "\114\x49\113\105", "\45" . $n3v4k . "\45"); qncne: goto p3Dwi; Z0tdf: $n3v4k = Arr::get($K6RJI, "\153\145\x79\167\x6f\x72\144", ''); $P3SHX = Arr::get($K6RJI, "\x73\164\141\x74\x75\163", ''); if (empty($n3v4k)) { goto qncne; } goto NsE9D; p3Dwi: if (!($P3SHX != '')) { goto ILYHh; } $KE3Ld->where("\x73\x74\141\x74\x75\x73", $P3SHX); ILYHh: goto vAsJA; xZbT9: $K6RJI = $request->all(); $KE3Ld = Order::notDeleted(); $OIL8d = Arr::get($K6RJI, "\154\x69\155\151\x74", static::ITEM_PER_PAGE); goto Z0tdf; vAsJA: $KE3Ld->orderBy("\x69\x64", "\104\x45\123\x43"); return OrderResource::collection($KE3Ld->paginate($OIL8d)); goto Biig1; Biig1: } public function all(Request $request) { $K6RJI = $request->all(); $OIL8d = Arr::get($K6RJI, "\154\x69\155\151\x74", static::ITEM_PER_PAGE); $KE3Ld = Order::select("\x69\144", "\x6e\x61\155\x65", "\x73\154\165\x67")->notDeleted()->orderBy("\x69\x64", "\x44\x45\123\103"); return OrderResource::collection($KE3Ld->paginate($OIL8d)); } public function allNested(Request $request) { goto ne1aR; ne1aR: $KF_o6 = Arr::get($request->all(), "\x69\x67\156\157\x72\145\x49\144", ''); $KE3Ld = Order::select("\x2a")->isPublished(); if (!($KF_o6 != null && $KF_o6 != '')) { goto mrAMX; } goto gscen; yX3C5: $poIhM = $this->getChildItems($KE3Ld, 0); return response()->json(["\x64\141\x74\141" => $poIhM], 200); goto m9z9T; gscen: $KE3Ld = $KE3Ld->where("\151\x64", "\41\x3d", $KF_o6); mrAMX: $KE3Ld = $KE3Ld->orderBy("\x69\144", "\x44\105\x53\x43")->get(); goto yX3C5; m9z9T: } public function getChildItems($KE3Ld, $Iz_gA = 0) { $poIhM = []; foreach ($KE3Ld as $Tv63A) { goto exp66; rM8e3: if (!($WoL7L !== null && count($WoL7L) > 0)) { goto VeW0X; } $B2wrs["\x63\x68\x69\x6c\144\x72\x65\156"] = $WoL7L; VeW0X: goto ZT1_k; exp66: if (!($Tv63A->parent_id == $Iz_gA)) { goto es2M_; } $B2wrs = ["\x76\x61\x6c\x75\x65" => $Tv63A->id, "\154\x61\x62\145\154" => $Tv63A->name]; $WoL7L = $this->getChildItems($KE3Ld, $Tv63A->id); goto rM8e3; ZT1_k: $poIhM[] = $B2wrs; es2M_: IaeBj: goto naZ6W; naZ6W: } yYi2g: return $poIhM; } public function available(Request $request) { goto X2noX; L9VLr: return OrderResource::collection($KE3Ld->get()); goto yMvNL; VKn4G: $KE3Ld->where("\151\144", "\x21\75", $KF_o6); EE48M: $KE3Ld->orderBy("\151\144"); goto L9VLr; X2noX: $KF_o6 = Arr::get($request->all(), "\151\147\156\x6f\162\145\x49\x64", ''); $KE3Ld = Order::select("\151\144", "\x6e\141\155\145")->isPublished(); if (!($KF_o6 != null && $KF_o6 != '')) { goto EE48M; } goto VKn4G; yMvNL: } public function show($J3dxl = 0) { $OCmcy = Order::notDeleted()->where("\151\144", $J3dxl)->first(); if (isset($OCmcy)) { goto JD_dT; } return response()->json(["\145\162\162\x6f\x72\163" => "\x4f\162\x64\x65\x72\40\x69\163\40\x6e\x6f\x74\x20\x76\x61\154\x69\144"], 403); JD_dT: return new OrderResource($OCmcy); } public function store(Request $request) { return response()->json(null, 204); } public function update(Request $request, $J3dxl = 0) { goto nWRpq; zgBn9: foreach ($OCmcy->order_detail as $Tv63A) { $a2hdD = $Tv63A->price + $Tv63A->tax; x5uts: } kPl_J: $GZzd1 = User::where("\151\x64", $OCmcy->user_id)->first(); goto IJNO7; IJNO7: $Qn41g = isset($GZzd1->group) ? $GZzd1->group->point_rate : 1000; $nU1r6 = ceil($a2hdD / $Qn41g); $nU1r6 += $GZzd1->point; goto ssQYi; ssQYi: User::where("\151\144", $GZzd1->id)->update(["\x70\157\151\x6e\164" => $nU1r6]); MYo7G: return response()->json(null, 204); goto FGlfI; Zi_Ku: if (!isset($params["\160\x61\171\x6d\145\x6e\164\x5f\x73\x74\x61\x74\165\163"])) { goto lLBYx; } $tR89g["\160\141\x79\155\145\156\x74\x5f\163\164\141\164\165\x73"] = $params["\x70\141\171\x6d\x65\x6e\164\137\x73\x74\x61\x74\165\163"]; lLBYx: goto Wlftz; nWRpq: $OCmcy = Order::notDeleted()->where("\151\144", $J3dxl)->first(); if (isset($OCmcy)) { goto vAnlr; } return response()->json(["\x65\162\162\157\162\163" => "\x4f\162\144\145\x72\x20\151\163\x20\x6e\157\164\x20\x76\141\154\x69\x64"], 403); goto uFcnU; AHZnl: if (!isset($params["\x73\164\x61\164\165\x73"])) { goto vYHYS; } $tR89g["\x73\x74\x61\164\x75\163"] = $params["\x73\x74\x61\164\x75\x73"]; vYHYS: goto Zi_Ku; Wlftz: $OCmcy->update($tR89g); if (!(isset($params["\163\164\x61\x74\x75\x73"]) && ($params["\163\x74\141\x74\165\163"] == 4 || $params["\x73\164\x61\x74\x75\x73"] == "\64"))) { goto MYo7G; } $a2hdD = 0; goto zgBn9; uFcnU: vAnlr: $params = $request->all(); $tR89g = ["\165\x70\144\141\164\x65\x64\x5f\x61\x74" => date("\x59\55\155\55\x64\x20\x48\72\x69\x3a\x73")]; goto AHZnl; FGlfI: } public function destroy($J3dxl = 0) { $OCmcy = Order::notDeleted()->where("\x69\144", $J3dxl)->first(); if (isset($OCmcy)) { goto HDW3Q; } response()->json(["\x65\x72\162\157\x72" => "\105\x68\x68\150\41\40\x43\x61\156\x20\x6e\x6f\x74\x20\x64\145\x6c\145\164\145\40\x74\150\151\163\40\x6f\162\x64\145\x72"], 403); HDW3Q: try { $OCmcy->update(["\x69\x73\137\144\x65\x6c\x65\x74\x65\144" => true]); } catch (\Exception $XjCL5) { response()->json(["\x65\x72\x72\157\x72" => $XjCL5->getMessage()], 403); } return response()->json(null, 204); } public function destroyMultiple(Request $request) { goto jQ4I8; D3XfE: try { Order::notDeleted()->whereIn("\x69\144", $V2bjl)->update(["\x69\x73\x5f\144\145\x6c\x65\x74\145\144" => true]); } catch (\Exception $XjCL5) { response()->json(["\145\x72\x72\157\x72" => $XjCL5->getMessage()], 403); } return response()->json(null, 204); goto B5rtc; rXz3D: if (!($dFB19->count() <= 0)) { goto PoLbm; } response()->json(["\145\x72\x72\157\x72" => "\117\x72\144\x65\x72\40\x69\x73\40\x6e\x6f\x74\x20\x76\141\x6c\x69\x64\x2e"], 403); PoLbm: goto D3XfE; YYql1: UP0qy: $V2bjl = $request->get("\151\144\163", []); $dFB19 = Order::notDeleted()->whereIn("\151\x64", $V2bjl)->get(); goto rXz3D; jQ4I8: $CvlrI = Validator::make($request->all(), ["\x69\144\163" => "\x72\145\x71\x75\x69\162\x65\144"]); if (!$CvlrI->fails()) { goto UP0qy; } return response()->json(["\x65\x72\162\157\x72\x73" => $CvlrI->errors()], 403); goto YYql1; B5rtc: } public function activateMultiple(Request $request) { goto pgVEe; Hfy62: try { Order::notDeleted()->whereIn("\x69\144", $V2bjl)->update(["\151\163\x5f\141\143\x74\x69\x76\x61\164\145\144" => true]); } catch (\Exception $XjCL5) { response()->json(["\145\162\162\x6f\162" => $XjCL5->getMessage()], 403); } return response()->json(null, 204); goto Qrtir; FSuie: if (!($dFB19->count() <= 0)) { goto eQO5D; } response()->json(["\145\162\x72\x6f\x72" => "\117\x72\144\145\x72\x20\x69\x73\x20\156\157\x74\x20\166\141\154\x69\x64\56"], 403); eQO5D: goto Hfy62; r3Dsm: j2XF8: $V2bjl = $request->get("\x69\144\163", []); $dFB19 = Order::notDeleted()->whereIn("\151\144", $V2bjl)->get(); goto FSuie; pgVEe: $CvlrI = Validator::make($request->all(), ["\x69\144\163" => "\162\145\x71\x75\x69\x72\x65\x64"]); if (!$CvlrI->fails()) { goto j2XF8; } return response()->json(["\145\162\x72\157\162\x73" => $CvlrI->errors()], 403); goto r3Dsm; Qrtir: } public function deactivateMultiple(Request $request) { goto NZL3K; UoN4a: try { Order::notDeleted()->whereIn("\151\144", $V2bjl)->update(["\x69\x73\x5f\141\143\164\x69\166\141\x74\145\x64" => false]); } catch (\Exception $XjCL5) { response()->json(["\x65\x72\x72\x6f\162" => $XjCL5->getMessage()], 403); } return response()->json(null, 204); goto hJ271; IkMBU: Gy0_A: $V2bjl = $request->get("\x69\x64\163", []); $dFB19 = Order::notDeleted()->whereIn("\x69\144", $V2bjl)->get(); goto XIchD; NZL3K: $CvlrI = Validator::make($request->all(), ["\x69\144\x73" => "\162\x65\x71\165\151\162\x65\x64"]); if (!$CvlrI->fails()) { goto Gy0_A; } return response()->json(["\x65\x72\162\157\x72\163" => $CvlrI->errors()], 403); goto IkMBU; XIchD: if (!($dFB19->count() <= 0)) { goto HtDf3; } response()->json(["\145\162\x72\x6f\x72" => "\x4f\x72\144\145\162\x20\151\x73\40\x6e\x6f\164\40\x76\141\x6c\151\144\x2e"], 403); HtDf3: goto UoN4a; hJ271: } public function position(Request $request) { goto YaOcm; kttdo: QbzVz: O8pJp: return response()->json(null, 204); goto uSc1K; YaOcm: if ($request->has("\x70\x6f\163\151\x74\151\157\156")) { goto M1wUT; } return response()->json(["\x65\x72\x72\x6f\162\163" => "\x44\141\x74\141\x20\x69\x73\40\x69\x6e\x76\141\154\151\x64"], 403); M1wUT: goto H5ZEM; H5ZEM: $sII2x = $request->position; if (!is_array($sII2x)) { goto O8pJp; } foreach ($sII2x as $Tv63A) { Order::where("\151\144", $Tv63A["\151\144"])->update(["\x70\157\x73\x69\x74\x69\157\156" => $Tv63A["\157\162\x64\145\162"]]); rlrlk: } goto kttdo; uSc1K: } }