|
|
|
|
@ -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;
|
|
|
|
|
|