2017-08-30 5 views

答えて

2

あなたは両方の方法を試すことができます:

DB::table('product_warehouse') 
    ->where('product_id', $product_id) 
    ->where('warehouse_id', $warehouse_id) 
    ->update(['product_qty' => DB::raw('product_qty + ' . $product_qty)]); 

それとも

DB::table('product_warehouse') 
    ->where('product_id', $product_id) 
    ->where('warehouse_id', $warehouse_id) 
    ->increment('product_qty', $product_qty); 
+1

第二1のおかげで動作します –