Cml\Model::updateByColumn PHP Method

updateByColumn() public method

通过字段更新数据-快捷方法
public updateByColumn ( integer $val, array $data, string $column = null, string $tableName = null, mixed $tablePrefix = null ) : boolean
$val integer 字段值
$data array 更新的数据
$column string 字段名 不传会自动分析表结构获取主键
$tableName string 表名 不传会自动从当前Model中$table属性获取
$tablePrefix mixed 表前缀 不传会自动从当前Model中$tablePrefix属性获取再没有则获取配置中配置的前缀
return boolean
    public function updateByColumn($val, $data, $column = null, $tableName = null, $tablePrefix = null)
    {
        is_null($tableName) && ($tableName = $this->getTableName());
        is_null($tablePrefix) && ($tablePrefix = $this->tablePrefix);
        is_null($column) && ($column = $this->db($this->getDbConf())->getPk($tableName, $tablePrefix));
        return $this->db($this->getDbConf())->where($column, $val)->update($tableName, $data, true, $tablePrefix);
    }