|
@@ -26,6 +26,7 @@ class WriteOffController extends Curd
|
|
|
$userId = $request->get('user_id', '');
|
|
|
$premises = $request->get('premises', '');
|
|
|
$date = $request->get('date', []);
|
|
|
+ $memberId = $request->get('member_id','');
|
|
|
|
|
|
$appointmentList = Db::table('appointment')
|
|
|
->leftJoin('member', 'member.member_id', '=', 'appointment.join_appointment_member_id')
|
|
@@ -39,12 +40,12 @@ class WriteOffController extends Curd
|
|
|
$date[0] = date('Y-m-d', strtotime($date[0])) . ' 00:00:00';
|
|
|
$date[1] = date('Y-m-d', strtotime($date[1])) . ' 23:59:59';
|
|
|
$query->whereBetween('appointment.appointment_done_datetime', $date);
|
|
|
- })
|
|
|
- ->when($userId != '', function ($query) use ($userId) {
|
|
|
+ })->when($userId != '', function ($query) use ($userId) {
|
|
|
$query->whereJsonContains('appointment.appointment_done_json->charge->charge_user_id', $userId);
|
|
|
- })
|
|
|
- ->when($premises != '', function ($query) use ($premises) {
|
|
|
+ })->when($premises != '', function ($query) use ($premises) {
|
|
|
$query->whereJsonContains('appointment.appointment_done_json->charge->charge_premises', $premises);
|
|
|
+ })->when(!empty($memberId),function ($query) use ($memberId){
|
|
|
+ $query->where('join_appointment_member_id',$memberId);
|
|
|
})
|
|
|
->where('appointment_status', 'DONE');
|
|
|
$quotaList = Db::table('member_quota')
|