settter
parent
18ebd1fcc9
commit
153b392a39
|
@ -82,8 +82,13 @@ class BillRepository extends Repository
|
|||
*/
|
||||
public function apiBillList($page, $size, $businessCode = null,$startTime = null, $endTime = null, $orders = ["id" => "desc"])
|
||||
{
|
||||
|
||||
return CouponBill::with(["couponMain","account"])
|
||||
$failData = [
|
||||
'total' => 0,
|
||||
'current' => $page,
|
||||
'size' => $size,
|
||||
'list' => new Collection(),
|
||||
];
|
||||
$rep = CouponBill::with(["couponMain","account"])
|
||||
->when(!empty($businessCode), function ($q) use ($businessCode) {
|
||||
$q->where("business_code", "=", $businessCode);
|
||||
})
|
||||
|
@ -92,10 +97,13 @@ class BillRepository extends Repository
|
|||
})
|
||||
->when(!empty($endTime), function ($q) use ($endTime) {
|
||||
$q->whereTime("create_time", "<=", $endTime);
|
||||
})
|
||||
->page($page,$size)
|
||||
});
|
||||
;
|
||||
$failData["total"] = $rep->count();
|
||||
$failData["list"] = $rep->page($page,$size)
|
||||
->order($orders)
|
||||
->select();
|
||||
return $failData;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue