reset
This commit is contained in:
parent
1351b340a8
commit
f9b442ff41
@ -55,12 +55,14 @@ class CardService extends Service
|
|||||||
if (isset($conditions['card_status'])) {
|
if (isset($conditions['card_status'])) {
|
||||||
$conditions['type'] = [0, 1, 2];
|
$conditions['type'] = [0, 1, 2];
|
||||||
$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();
|
||||||
|
$this->orderCardPartitionRepository->resetModel();
|
||||||
|
|
||||||
$subQuery = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->currentModel();
|
$subQuery = $this->orderCardPartitionRepository->selectRaw('sim')->withConditions($conditions)->currentModel();
|
||||||
$res = DB::table(DB::raw("({$subQuery->toSql()}) as sub"))
|
$res = DB::table(DB::raw("({$subQuery->toSql()}) as sub"))
|
||||||
->select(DB::raw('count(*) as total'))
|
->select(DB::raw('count(*) as total'))
|
||||||
->mergeBindings($subQuery->getQuery())
|
->mergeBindings($subQuery->getQuery())
|
||||||
->first();
|
->first();
|
||||||
|
$this->orderCardPartitionRepository->resetModel();
|
||||||
|
|
||||||
$total = $res->total;
|
$total = $res->total;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user