check($data,[],$scene); if(true !== $result){ $this->error = validate($valiname)->getError(); return false; } $id = $data['id']; unset($data['id']); if($id > 0){ $ret = $this->allowField(true)->save($data,['id'=>$id]); }else{ $ret = $this->allowField(true)->save($data); } if(!$ret){ $this->error = '操作失败'; return false; } return true; } public function getTableField($table,$where,$field){ $val = Db::name($table) ->where($where) ->value($field); return $val?$val:""; } }