update fix deadcode, security
This commit is contained in:
@@ -16,20 +16,6 @@ class InvoiceItemCachedRepository extends BaseCachedRepository implements Invoic
|
||||
{
|
||||
return $this->invoiceItemRepository->getModel();
|
||||
}
|
||||
public function getItemBy(array $type_in = [], int $invoice_type_id = 0)
|
||||
{
|
||||
$cacheKey = $this->getCacheKey(md5(json_encode(
|
||||
[
|
||||
'getItemBy' => [
|
||||
'type_in' => $type_in,
|
||||
'invoice_type_id' => $invoice_type_id
|
||||
]
|
||||
]
|
||||
)));
|
||||
return Cache::remember($cacheKey, $this->cacheTime, function () use ($type_in, $invoice_type_id) {
|
||||
return $this->invoiceItemRepository->getItemBy($type_in, $invoice_type_id);
|
||||
});
|
||||
}
|
||||
public function findBy(int $userId = 0, array $data = [], array $relationships = [])
|
||||
{
|
||||
$cacheKey = $this->getCacheKey(md5(json_encode(
|
||||
@@ -59,19 +45,6 @@ class InvoiceItemCachedRepository extends BaseCachedRepository implements Invoic
|
||||
return $this->invoiceItemRepository->filter($data, $relationships, $withCount, $select);
|
||||
});
|
||||
}
|
||||
public function findServiceStatus(int $relid = 0, int $type_id = 0)
|
||||
{
|
||||
$cacheKey = $this->getCacheKey(md5(json_encode([
|
||||
'findServiceStatus' => [
|
||||
'relid' => $relid,
|
||||
'type_id' => $type_id,
|
||||
|
||||
]
|
||||
])));
|
||||
return Cache::remember($cacheKey, $this->cacheTime, function () use ($relid, $type_id) {
|
||||
return $this->invoiceItemRepository->findServiceStatus($relid, $type_id);
|
||||
});
|
||||
}
|
||||
public function findWithRelationships(int $id = 0, array $relationships = [],array $withCount = [], array $withSum = [])
|
||||
{
|
||||
$cacheKey = $this->getCacheKey(md5(json_encode([
|
||||
|
||||
@@ -19,13 +19,6 @@ class InvoiceItemRepository extends BaseRepository implements InvoiceItemReposit
|
||||
{
|
||||
return InvoiceItem::class;
|
||||
}
|
||||
public function getItemBy(array $type_in = [], int $invoice_type_id = 0)
|
||||
{
|
||||
return $this->model->with(['hosting', 'vps', 'os'])->where(function ($query) use ($type_in, $invoice_type_id) {
|
||||
$query->whereIn('product_type', $type_in);
|
||||
$query->where('invoice_type', $invoice_type_id);
|
||||
})->get();
|
||||
}
|
||||
public function findBy(int $userId = 0, array $data = [], array $relationships = [])
|
||||
{
|
||||
$query = $this->model->with($relationships);
|
||||
@@ -113,14 +106,6 @@ class InvoiceItemRepository extends BaseRepository implements InvoiceItemReposit
|
||||
}
|
||||
return $model->get();
|
||||
}
|
||||
public function findServiceStatus(int $relid = 0, int $type_id = 0)
|
||||
{
|
||||
return match ($type_id) {
|
||||
3 => $this->hostingRepository->find($relid),
|
||||
4 => $this->vmwareRepository->find($relid),
|
||||
default => null
|
||||
};
|
||||
}
|
||||
public function findWithRelationships(int $id = 0, array $relationships = [], array $withCount = [], array $withSum = [])
|
||||
{
|
||||
$model = $this->model;
|
||||
|
||||
@@ -4,10 +4,7 @@ namespace App\Repositories\InvoiceItem;
|
||||
use App\Repositories\BaseRepositoryInterface;
|
||||
|
||||
interface InvoiceItemRepositoryInterface extends BaseRepositoryInterface{
|
||||
public function getItemBy(array $type_in = [], int $invoice_type_id = 0);
|
||||
public function findBy(int $userId = 0, array $data = [],array $relationships = []);
|
||||
public function filter(array $data = [],array $relationships = [],array $withCount = [],array $select = ['*']);
|
||||
public function findServiceStatus(int $relid = 0, int $type_id = 0);
|
||||
public function findWithRelationships(int $id = 0, array $relationships = [],array $withCount = [], array $withSum = []);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user