xyf90314 2018-09-04 09:06:51 12998次浏览 3条评论 3 2 0

用于数字类型,将值进行 累加 或者 累减

$count = 1, 就是加一
$count = -1, 就是减一

User::updateAllCounters(['sort' => $count], ['id' => 2]);

参考:http://www.neatstudio.com/show-2703-1.shtml http://www.mamicode.com/info-detail-2330061.html

觉得很赞
您需要登录后才可以评论。登录 | 立即注册