| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/bitnami/apache/htdocs/app/app/Http/Services/ |
Upload File : |
<?php
namespace App\Http\Services;
use App\Models\Pricing;
use Cache;
class PricingService{
// public function getPricingFees($type_id = 0)
// {
// // Cache::forget('pricingList-#'.$type_id);
// $pricing = Cache::rememberForever('pricingList-#'.$type_id, function () use ($type_id){
// $data = Pricing::where("type_id", $type_id)->firstOr(function() use ($type_id){
// return [
// "id" => 0,
// "price" => 0,
// "type_id" => $type_id,
// "minute" => $type_id == Pricing::OVERTIME_FEES ? 30 : 60,
// ];
// });
// return $data;
// });
// return $pricing;
// }
// public function pricingList(Array $request)
// {
// $pricings = [
// "booking_fees" => self::getPricingFees(Pricing::BOOKING_FEES),
// "overtime_fees" => self::getPricingFees(Pricing::OVERTIME_FEES),
// ];
// return $pricings;
// }
// public function pricingUpdateOrCreate(Array $request)
// {
// $pricing = Pricing::updateOrCreate([
// 'id' => $request['id'],
// 'type_id' => $request['type_id'],
// ],[
// 'title' => $request['title'] ?? Pricing::TYPES[$request['type_id']],
// 'price' => $request['price'],
// 'type_id' => $request['type_id'],
// "minute" => $request['type_id'] == Pricing::OVERTIME_FEES ? 30 : 60,
// ]);
// Cache::forget('pricingList-#'.$request['type_id']);
// return $pricing;
// }
}