//有些查詢條件被拼接的實在難以捋,記錄一下這麼好用的功能
public function index(Request $request)\
{
//開啟
DB::enableQueryLog();
$this->passRecordRepository->pushCriteria(new RequestCriteria($request));
$this->passRecordRepository->pushCriteria(new PassRecordSearchCriteria($request));
$this->passRecordRepository->pushCriteria(new DeviceCriteria($request));
$this->passRecordRepository->pushCriteria(new DateCriteria($this->getStartDate($request) , $this->getEndDate($request)));
$passRecords = $this->passRecordRepository->orderBy('ts', 'DESC')->paginate(100);
//列印
dd(DB::getQueryLog());
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結