count
This commit is contained in:
parent
d5c186aa0b
commit
6bc77e7e91
@ -52,16 +52,16 @@ class CardService extends Service
|
||||
|
||||
if (isset($conditions['card_status'])) {
|
||||
$conditions['type'] = [0, 1, 2];
|
||||
$total = $this->orderCardPartitionRepository->withConditions($conditions)->count();
|
||||
$simArray = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->orderBy('sim')->forPage($page, $limit)->get()->pluck('sim')->toArray();
|
||||
$cards = $this->orderCardPartitionRepository->select($select)->whereIn('sim', $simArray)->get();
|
||||
$cards = $this->orderCardPartitionRepository->select($select)->where('type', 0)->whereIn('sim', $simArray)->get();
|
||||
} else {
|
||||
$total = $this->orderCardPartitionRepository->withConditions($conditions)->count();
|
||||
$cards = $this->orderCardPartitionRepository->select($select)->withConditions($conditions)->orderBy('created_at', 'desc')->forPage($page, $limit)->get();
|
||||
}
|
||||
|
||||
$cards = static::transformer($cards);
|
||||
|
||||
$total = $this->orderCardPartitionRepository->withConditions($conditions)->count();
|
||||
|
||||
return new LengthAwarePaginator($cards, $total, $limit);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user