我对Laravel的模型有一个问题。
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Offices extends Model
{
protected $primaryKey = null;
public $incrementing = false;
public $timestamps = false;
}
那是我的模特。当我尝试查询时这样做:
$office = Offices::where('worker_id', '=', $worker->id)->first();
我收到一个奇怪的错误
Column not found: 1054 Unknown column '' in 'where clause' (SQL: update `offices` set `visit_called_id` = 125 where `` is null)
我错过了什么?我想我已经包含了应该使它工作的所有代码:/