field('price,cart_num,rose')->find(); if ($find && $find['rose'] > 0) { $product = StoreBranchProduct::where('store_id', $store_id)->where('product_id', $product_id)->find(); if ($product) { if ($product['rose'] >= 4 && $product['rose'] < 8) { $rose = bcdiv($find['rose'], 100, 2); $commission = bcmul($product['purchase'], $rose, 4); StoreFinanceFlowProduct::create([ 'store_id' => $store_id, 'product_id' => $product_id, 'number' => $commission, 'oid' => $oid, 'type' => 2, 'status' => 1, ]); } elseif ($product['rose'] >= 8) { } } $price = bcmul($find['price'], $find['cart_num'], 2); // $price=bcsub($price, $price // ) // bcsub($price, $find['rose'], 2); // return $price; } } }