|
|
@@ -267,12 +267,16 @@ class RewardPointRepository extends Repository
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- public function getHistory($customerId, $limit = 20)
|
|
|
+ public function getHistory($customerId, $limit = 20, $page = null)
|
|
|
{
|
|
|
- return $this->where('customer_id', $customerId)
|
|
|
- ->orderBy('transaction_time', 'desc')
|
|
|
- ->paginate($limit);
|
|
|
+ $query = $this->where('customer_id', $customerId)
|
|
|
+ ->orderBy('transaction_time', 'desc');
|
|
|
+
|
|
|
+ if ($page) {
|
|
|
+ return $query->paginate($limit, ['*'], 'page', $page);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $query->paginate($limit);
|
|
|
}
|
|
|
|
|
|
public function checkExpiredPoints()
|