diff --git a/app/Domains/Virtual/Services/CardService.php b/app/Domains/Virtual/Services/CardService.php index 2f47ff66..0ddd5ee4 100644 --- a/app/Domains/Virtual/Services/CardService.php +++ b/app/Domains/Virtual/Services/CardService.php @@ -55,12 +55,14 @@ class CardService extends Service if (isset($conditions['card_status'])) { $conditions['type'] = [0, 1, 2]; $simArray = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->orderBy('sim')->forPage($page, $limit)->get()->pluck('sim')->toArray(); + $this->orderCardPartitionRepository->resetModel(); $subQuery = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->currentModel(); $res = DB::table(DB::raw("({$subQuery->toSql()}) as sub")) ->select(DB::raw('count(*) as total')) ->mergeBindings($subQuery->getQuery()) ->first(); + $this->orderCardPartitionRepository->resetModel(); $total = $res->total;