我會得到所有項目從表,其中結束日期爲> =現在日期和結束日期爲NULL並公佈= 1雄辯 - 當日期> =日期(現在)和whereNull(「日」)
這就是我有,但給我0項目:
$items = Items::orderBy(\DB::raw('RAND()'))
->where('endDate', '>=', date("Y-m-d"))
->whereNull('endDate')
->where('published', '1')
->whereIn('cid', $this->activeId)
->orderBy('id')
->paginate(4);
你爲什麼包括' - >在哪裏( '可用',「1 ')'如果你想用' - > where('published','1')'來獲取數據。可能是這個問題 –