|
|
|
@ -428,7 +428,7 @@ class StatisticsController extends CommonController
|
|
|
|
public function getLies($bedIds, $productItem, $factor)
|
|
|
|
public function getLies($bedIds, $productItem, $factor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$list = [];
|
|
|
|
$list = [];
|
|
|
|
DB::enableQueryLog();
|
|
|
|
// DB::enableQueryLog();
|
|
|
|
foreach ($productItem as $item) {
|
|
|
|
foreach ($productItem as $item) {
|
|
|
|
foreach ($factor as $factor_item) {
|
|
|
|
foreach ($factor as $factor_item) {
|
|
|
|
$total = OrderItems::where('product_item_id', $item->id)
|
|
|
|
$total = OrderItems::where('product_item_id', $item->id)
|
|
|
|
@ -436,7 +436,6 @@ class StatisticsController extends CommonController
|
|
|
|
//->whereRaw("factors like '%\"factor_item_id\": $factor_item->id%'")
|
|
|
|
//->whereRaw("factors like '%\"factor_item_id\": $factor_item->id%'")
|
|
|
|
->sum('total');
|
|
|
|
->sum('total');
|
|
|
|
//dd(DB::getQueryLog());
|
|
|
|
//dd(DB::getQueryLog());
|
|
|
|
|
|
|
|
|
|
|
|
$list [] = [
|
|
|
|
$list [] = [
|
|
|
|
'name' => $item->price + $factor_item->price . '元/天',
|
|
|
|
'name' => $item->price + $factor_item->price . '元/天',
|
|
|
|
'total_price' => $item->price + $factor_item->price,
|
|
|
|
'total_price' => $item->price + $factor_item->price,
|
|
|
|
@ -444,22 +443,9 @@ class StatisticsController extends CommonController
|
|
|
|
'factor_item_id' => $factor_item->id,
|
|
|
|
'factor_item_id' => $factor_item->id,
|
|
|
|
'total' => $total
|
|
|
|
'total' => $total
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $list;
|
|
|
|
return $list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 根据产品子项id和因素子项id算出收入
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function lieToMoney($product_item_id, $factor_item_id, $orderIds)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$total = OrderItems::where('product_item_id', $product_item_id)
|
|
|
|
|
|
|
|
# ->whereRaw("factors like '%\"factor_item_id\": $factor_item_id%'")
|
|
|
|
|
|
|
|
# ->whereIn('order_id', $orderIds)
|
|
|
|
|
|
|
|
->sum('total');
|
|
|
|
|
|
|
|
return $total;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|