Laravel将查询数组更新为字符串转换

I'm processing batch jobs via a custom artisan command

I have a function that checks the job queue then attempts to update the job list

$batch_check = DB::table('jobs_has_batch_job_queue')
        ->where('jobs_job_id',$this->job_id[0]->job_id)
        ->get();

    if(count($batch_check) < 1)
    {
        var_dump($this->job_id[0]->job_id);die; 
        $this->info('Job Complete');
        DB::table('jobs')
            ->where('jobs_job_id',$this->job_id[0]->job_id)
            ->update(['status' => 'complete']);
    }

The $batch_check returns an empty array

and I see the

        $this->info('Job Complete');

echoed back in terminal and

$this->job_id[0]->job_id

returns back an integer, i get this value by running the following at the start of the batch process

        $this->job_id = DB::table('jobs')
            ->where('status','incomplete')
            ->limit(1)
            ->get();

all the docs say to pass an array to -> update

If anyone can spot where I'm going wrong it would be great.

James Kirkby

First check that

$this->job_id[0]->job_id

give you any value or not if it give you a value then check that jobid is exist in database or not

 $exist = DB::table('jobs')
    ->where('jobs_job_id',$this->job_id[0]->job_id)->first();


dd(exist);