wesmiler 23 小時之前
父節點
當前提交
a41056dc41
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      app/Services/Api/GoodsService.php

+ 7 - 1
app/Services/Api/GoodsService.php

@@ -125,6 +125,12 @@ class GoodsService extends BaseService
                     $query->where('a.category_id', $categoryId);
                 }
 
+                // 套餐类型
+                $mealType = isset($params['meal_type'])? intval($params['meal_type']) : 0;
+                if($mealType>0){
+                    $query->where('a.meal_type', $mealType);
+                }
+
                 // 企业
                 $storeId = isset($params['store_id'])? intval($params['store_id']) : 0;
                 if($storeId>0){
@@ -356,7 +362,7 @@ class GoodsService extends BaseService
                     $item['cost_price'] = $costPrice;
                     $item['total'] = $price;
                     $profitTotal = round(max(0,($price-$costPrice) * $num),2);
-                    $netProfit = moneyFormat($profitTotal * $profitRate/100, 2);
+                    $netProfit = round($profitTotal * $profitRate/100, 2);
                     $item['profit_total'] = $profitTotal; // 毛利
                     $item['net_profit'] = $netProfit; // 净利润
                     $item['num'] = $num;