Merge pull request 'feat(CommissionProductLogic): updated prod calc logic for user ship condition, added source check for order, improved code quality' (#220) from dev into main

Reviewed-on: #220
This commit is contained in:
mkm 2024-09-19 22:45:08 +08:00
commit 75f33778e5

View File

@ -23,7 +23,11 @@ class CommissionProductLogic extends BaseLogic
*/
function calculate_product_flow($find, $order, $village_uid = 0, $brigade_uid = 0, $user_ship = 0, $spread_user_ship = 0)
{
$product = StoreProduct::where('id', $find['product_id'])->find();
if(isset($order['source']) && $order['source'] == 2){
$product = StoreBranchProduct::where('product_id', $find['product_id'])->where('store_id', $order['store_id'])->find();
}else{
$product = StoreProduct::where('id', $find['product_id'])->find();
}
if ($product) {
//活动商品
if ($product['product_type'] == 4) {