【发布时间】:2015-01-28 08:16:12
【问题描述】:
欢迎, 我该如何使用
lockForUpdate
在我的带有 laravel4 restiful 控制器的编辑页面中
【问题讨论】:
欢迎, 我该如何使用
lockForUpdate
在我的带有 laravel4 restiful 控制器的编辑页面中
【问题讨论】:
有了这样一个笼统的答案,我只能给你一个笼统的答案:
$model = Model::where('id', $id)->lockForUpdate()->first();
【讨论】:
// $cc = DB::select ('select * from customers where transaction_id = '.$_GET['edit'].' FOR UPDATE'); $cc = Customer::where('transaction_id', $_GET['edit'])->lockForUpdate()->first();
locked 字段,并在有人打开编辑表单时将其设置为 true。