您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
webman-查詢構造器-自增 & 自减
发布时间:2022-02-06 21:39:59编辑:雪饮阅读()
實例:
public function index(Request $request)
{
ini_set('memory_limit','4096M');
//自增、自減方法都至少接收一个参数:需要修改的列。第二个参数是可选的,用于控制列递增或递减的量
Db::table('ecms_news')->increment('ttid');
Db::table('ecms_news')->increment('ttid',50);
Db::table('ecms_news')->decrement('ttid');
Db::table('ecms_news')->decrement('ttid',40);
//你也可以在操作过程中指定要更新的字段
Db::table('ecms_news')->increment('ttid', 11, ['username' => 'kasumi']);
Db::table('ecms_news')->decrement('ttid', 10, ['username' => 'kasumi2']);
return response("ok");
}
关键字词:webman,查詢構造器,自增,自减
下一篇:webman-查詢構造器-刪除