天天看点

thinkphp修改数据表时怎么实现字段自加1

$User->where('id=5')->setInc('score',); // 用户的积分加3
$User->where('id=5')->setInc('score'); // 用户的积分加1
$User->where('id=5')->setDec('score',); // 用户的积分减5
$User->where('id=5')->setDec('score'); // 用户的积分减1