|
|
@@ -73,13 +73,13 @@ class Voucher extends BaseModel
|
|
|
|
|
|
public function fetchVoucher($user_id, $status, $page = 1, $size = 10)
|
|
|
{
|
|
|
- return $this->alias("uv")
|
|
|
+ return $this
|
|
|
->with("voucherinfo")
|
|
|
->where([
|
|
|
- "uv.user_id" => $user_id,
|
|
|
+ "user_id" => $user_id,
|
|
|
])
|
|
|
- ->where("uv.status", "<>", \E_VOUCHER_STATUS::Use)
|
|
|
- ->where("uv.status", "in", $status)
|
|
|
+ ->where("status", "<>", \E_VOUCHER_STATUS::Use)
|
|
|
+ ->where("status", "in", $status)
|
|
|
->page($page)
|
|
|
->paginate($size);
|
|
|
}
|