1
我該如何增加?取而代之的+1只顯示 '1'如何用散列火箭增加?
\App\Coupon::where('coupon_id','=',$coupon[0]->coupon_id)->update(['no_applied' => 'no_applied'+1]);
我該如何增加?取而代之的+1只顯示 '1'如何用散列火箭增加?
\App\Coupon::where('coupon_id','=',$coupon[0]->coupon_id)->update(['no_applied' => 'no_applied'+1]);
您可以使用justr increment
方法:
App\Coupon::where('coupon_id','=',$coupon[0]->coupon_id)->increment('no_applied');
你是對的。謝謝。我會在後面標記你的答案,因爲stackoverflow不會允許我。無法接受10分鐘的答案 –
是否要追加'1',而不是添加呢? –
@AlexanderFarber增量是正常的,但你能教我如何追加?我想學習 –