first
This commit is contained in:
parent
098b6830d0
commit
1351b340a8
@ -57,12 +57,13 @@ class CardService extends Service
|
|||||||
$simArray = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->orderBy('sim')->forPage($page, $limit)->get()->pluck('sim')->toArray();
|
$simArray = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->orderBy('sim')->forPage($page, $limit)->get()->pluck('sim')->toArray();
|
||||||
|
|
||||||
$subQuery = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->currentModel();
|
$subQuery = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->currentModel();
|
||||||
$query = DB::table(DB::raw("({$subQuery->toSql()}) as sub"))
|
$res = DB::table(DB::raw("({$subQuery->toSql()}) as sub"))
|
||||||
->select(DB::raw('count(sim)'))
|
->select(DB::raw('count(*) as total'))
|
||||||
->mergeBindings($subQuery->getQuery())
|
->mergeBindings($subQuery->getQuery())
|
||||||
->get();
|
->first();
|
||||||
|
|
||||||
|
$total = $res->total;
|
||||||
|
|
||||||
$total = $query->count;
|
|
||||||
$cards = $this->orderCardPartitionRepository->select($select)->where('type', 0)->whereIn('sim', $simArray)->get();
|
$cards = $this->orderCardPartitionRepository->select($select)->where('type', 0)->whereIn('sim', $simArray)->get();
|
||||||
} else {
|
} else {
|
||||||
$total = $this->orderCardPartitionRepository->withConditions($conditions)->count();
|
$total = $this->orderCardPartitionRepository->withConditions($conditions)->count();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user