Laravel 쿼리가 실패했지만 PhpMyadmin에서 동일한 코드가 작동합니다.
P粉111627787
P粉111627787 2023-08-15 17:54:08
0
1
422
<p>이것은 내 Laravel 애플리케이션의 코드입니다: </p> <pre class="brush:php;toolbar:false;">공개 함수 sendNotifications() { $matchingSubscriptions = DB::table('tournament_match_plan') ->join('push_subscriptions', 'push_subscriptions.age_group', '=', 'tournament_match_plan.league') ->where('tournament_match_plan.start', '=', '11:20:00') ->where('tournament_match_plan.team_1', '=', 'push_subscriptions.club') ->orwhere('tournament_match_plan.team_2', '=', 'push_subscriptions.club') ->get(); dd($matchingSubscriptions); }</pre> <p>디버깅 결과는 다음과 같습니다.</p> <pre class="brush:php;toolbar:false;">IlluminateSupportCollection {#751 ▼ // appHttpControllersGuestsGuestsPushController.php:97 #항목: [] #escapeWhenCastingToString: 거짓 }</pre> <p>내 Laravel 코드가 결과를 얻지 못하는 이유는 무엇입니까? </p> <p>PhpMyAdmin에서 동일한 쿼리를 시도했습니다: </p> <pre class="brush:php;toolbar:false;">SELECT * 토너먼트_매치_플랜에서 push_subscriptions ON push_subscriptions.age_group = 토너먼트_매치_플랜.리그에 참여하세요. 어디 Tournament_match_plan.start = '11:20:00' AND (tournament_match_plan.team_1 = push_subscriptions.club OR Tournament_match_plan.team_2 = push_subscriptions.club);</pre> <p>이 쿼리를 사용하여 결과를 얻었는데 결과가 정확했습니다. </p>
P粉111627787
P粉111627787

모든 응답(1)
P粉198749929

아래는 작업 코드입니다.

으아악
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!