열을 찾을 수 없음: 1054 'where 절'의 알 수 없는 열 'tbl_destinations.id' PDOException: SQLSTATE: /var/www/html/...Connection.php:338에서 다시 작성됨: 열을 찾을 수 없음:1054 알 수 없는 열에 대한 데이터베이스 예외 'where 절'의 'tbl_destinations.id'
P粉677573079
P粉677573079 2023-12-12 22:07:26
0
1
447

내 데이터베이스의 id 필드는 des_id입니다. des_id로 변경하려면 어떻게 해야 하나요?

Route::post('Itest/LoadSuppliers', function (Request $request) {
    $request->validate([
        'destination_id' => 'required|exists:mysql.tbl_destinations,des_id',
        'from' => 'required|numeric|min:0',
        'to' => 'required|numeric|min:0',
    ]);
    $destination_id = Destination::where('des_id','=', $request->destination_id)->firstOrFail();
    $from = $request->from;
    $to = $request->to;
    dispatch(new TestJob($destination_id, $from, $to));
    return response()->json([
        'status' => true
    ]);
});

P粉677573079
P粉677573079

모든 응답(1)
P粉458725040

귀하의 코드가 좋아 보이네요.

대상 모델에서 이것을 설정해 보세요:

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