如下所示:

$rsdd = Db::name('coupon')->where('number',$couponarr[$i])->setInc('num2');//num2字段加 1 已经领优惠券人数

用setInc方法自动加1

字段默认值不能null,只能为0