0
我不是很有经验,而且遇到问题。我无法弄清楚如何使这个函数使用块。尝试所有,但得到错误,我认为我误解了一些东西。如何实现块
$companies_has = Company::whereHas('websites', function ($q) {
$q->where('updated_at', '<=', Carbon::now()->subMonth());
})->get();
$companies_doesnt_has = Company::whereDoesntHave('websites')->get();
$companies = $companies_has->merge($companies_doesnt_has);
foreach ($companies as $company) {
$this->getWebsite($company); }
这是您尝试使用块,或者是你想使用大块的方式?你能否更清楚地解释你的问题和错误? –
我只是不知道正确的方法来实现这个功能的块。现在它没有块。 –