request->get(); $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today'; $startTime = $get['startTime'] ?? ''; $endTime = $get['endTime'] ?? ''; $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true); $start = $period['startTime']; $end = $period['endTime']; $currentStartDate = date('Y-m-d', strtotime($start)); $currentEndDate = date('Y-m-d', strtotime($end)); $currentStartTime = $currentStartDate . ' 00:00:00'; $currentEndTime = $currentEndDate . ' 23:59:59'; $mainId = $this->mainId; $kindList = KindClass::getAllByCondition(['mainId' => $mainId, 'flower' => 1, 'delStatus' => 0, 'status' => 1], null, '*', 'id'); $arr = []; $where = ['mainId' => $mainId, 'status' => 1]; $where['finishTime'] = ['between', [$currentStartTime, $currentEndTime]]; $workList = WorkClass::getAllByCondition($where, null, '*', null, true); if (!empty($workList)) { foreach ($workList as $work) { $kindId = $work->kindId ?? 0; if (empty($kindId)) { continue; } $kindName = $kindList[$kindId]['name'] ?? ''; $num = $work->num ?? 0; if (isset($arr[$kindId]['makeNum'])) { $arr[$kindId]['makeNum'] = bcadd($arr[$kindId]['makeNum'], $num); } else { $arr[$kindId]['makeNum'] = $num; $arr[$kindId]['name'] = $kindName; } } } //util::success(['list' => $incomeList, 'totalIncome' => $totalIncome]); } }