liyinglin 2 years ago
parent 7f0e3319e7
commit 19e6dc5a07

@ -428,12 +428,14 @@ class StatisticsController extends CommonController
public function getLies($bedIds, $productItem, $factor)
{
$list = [];
DB::enableQueryLog();
foreach ($productItem as $item) {
foreach ($factor as $factor_item) {
$total = OrderItems::where('product_item_id', $item->id)
->whereIn("bed_id", $bedIds)
->whereRaw("factors like '%\"factor_item_id\": $factor_item->id%'")
->sum('total');
dd(DB::getQueryLog());
$list [] = [
'name' => $item->price + $factor_item->price . '元/天',
@ -442,6 +444,7 @@ class StatisticsController extends CommonController
'factor_item_id' => $factor_item->id,
'total' => $total
];
}
}
return $list;

Loading…
Cancel
Save