shopAdmin, $this->shop); if ($lookMoney == 0) { util::fail('无法查看'); } //惠雅鲜花员工不能看收入情况 $shopAdmin = $this->shopAdmin; $adminId = $shopAdmin->adminId ?? 0; if (in_array($adminId, [2366, 2812, 4004, 3405, 3407])) { util::fail('暂无权限'); } $get = Yii::$app->request->get(); $contain = $get['contain'] ?? 0; $return = StatKdClass::eachChannelIncome($this->mainId, $this->shop, $contain); $incomeList = $return['incomeList']; $staffAmountList = $return['staffAmountList']; $payCodeIncome = $return['payCodeIncome']; $lsAfterSale = $return['lsAfterSale']; $totalIncome = 0; if (!empty($incomeList)) { foreach ($incomeList as $item) { $amount = $item['amount'] ?? 0; $totalIncome = bcadd($totalIncome, $amount, 2); $totalIncome = floatval($totalIncome); } } util::success(['list' => $incomeList, 'totalIncome' => $totalIncome, 'staffAmountList' => $staffAmountList, 'payCodeIncome' => $payCodeIncome]); } /** * 跨天售后影响:筛售后创建时间,按原单账单日汇总日/月金额。 * PC /assets/nextDayAffect 使用;只计挂上 xhGhsOrder 的已通过跨天售后。 */ public function actionNextDayAffect() { $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop); if ($lookMoney == 0) { util::fail('无法查看'); } $get = Yii::$app->request->get(); $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today'; $startTime = $get['startTime'] ?? ''; $endTime = $get['endTime'] ?? ''; // 自系统升级以来:跨天售后从 2026-08-18 起算,结束用当前时刻 if ($searchTime === 'sinceUpgrade') { $period = [ 'startTime' => '2026-08-18 00:00:00', 'endTime' => date('Y-m-d H:i:s'), ]; } else { // 售后 addTime 用完整时分秒,不能走统计页的 Ymd $period = dateUtil::formatTime($searchTime, $startTime, $endTime, false); } $data = NextDayRefundClass::affectByOrderPayTime( $this->mainId, $period['startTime'], $period['endTime'] ); util::success($data); } }