settter
parent
3a808becd5
commit
0d1631cbb9
|
@ -225,8 +225,9 @@ class BillRepository extends Repository
|
|||
*/
|
||||
public function getAgencyMoneySum($field, $keyword = null, $start_time = null, $end_time = null)
|
||||
{
|
||||
|
||||
return CouponBill::alias("a")
|
||||
->join("business b", "a.business_code = b.code", "left")
|
||||
->join("business b", "a.business_code = b.code")
|
||||
->join("business e", "a.agency_code = e.code", "left")
|
||||
->join("account c", "a.user_code = c.user_code")
|
||||
->join("coupon_main d", "a.coupon_main_id = d.id")
|
||||
|
@ -240,7 +241,7 @@ class BillRepository extends Repository
|
|||
$q->whereTime("a.create_time", "<=", $end_time);
|
||||
})
|
||||
->when(MemberModel::is_agency(session("auth")['roles']), function ($q) {
|
||||
$q->where("a.agency_code", "=", session("auth")['business_code']);
|
||||
$q->where("b.agency_code", "=", session("auth")['business_code']);
|
||||
})
|
||||
->sum("a." . $field);
|
||||
}
|
||||
|
@ -281,6 +282,7 @@ class BillRepository extends Repository
|
|||
->join("business c", "a.business_code = c.code")
|
||||
->join("member d", "a.member_id = d.id", "left")
|
||||
->join("business e", "c.agency_code = e.code", "left")
|
||||
->where("a.state",Recharge::state_on)
|
||||
->when(!empty($keyword), function ($q) use ($keyword) {
|
||||
$q->whereTime("c.business_name|e.business_name", "like", "%" . $keyword . "%");
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue