thinkphp-自增或自减一个字段的值
说明
setInc/setDec方法返回影响数据的条数
自增
默认加1
示例
Db::table('think_user')->where('id',1)->setInc('score');
输出
1
加固定值
示例
Db::table('think_user')->where('id',1)->setInc('score',6);
输出
1
自减
默认减1
示例
Db::table('think_user')->where('id',1)->setDec('score');
输出
1
减固定值
示例
Db::table('think_user')->where('id',1)->setDec('score',3);
输出
1
延迟更新
Db::table('think_user')->where('id',1)->setInc('score',1,10);
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。