Call to a member function allowField() on null
在空对象上调用 allowField()
没有该模型对象无法调用,需要创建相应的模型
错误版本:
if ($this->$model->allowField(true)->isUpdate($isUpdate)->save($data) !== false) {
修改版本:
判断没有该模型就创建
$model = $this->model;
if (empty($model)) {
$model = new CorpModel;
}
if ($model->allowField(true)->isUpdate($isUpdate)->save($data) !== false) {