简单的单字段数据自减(多字段参考update)

$this->db()->decrement('user-id-1', 1, 'nums');

生成的语句 UPDATE pre_user SET nums = nums-1 WHERE id = 1;

//特别指定表前缀为u_(假设配置中配置的不为u_)v2.6.5起可用
$this->db()->decrement('user-id-1', 1, 'nums', 'u_');

生成的语句 UPDATE u_user SET nums = nums-1 WHERE id = 1;

results matching ""

    No results matching ""