shopId) || empty($this->mainId)) { util::fail('门店信息无效'); } try { $configs = PsMethodClass::getAllConfigs($this->shopId, $this->mainId); // 客户单独送货上门规则覆盖 style=0 if (!empty($this->custom) || !empty($this->hd)) { $customInfo = []; if (!empty($this->hd)) { $customInfo = is_array($this->hd) ? $this->hd : $this->hd->toArray(); } if (!empty($this->custom)) { $customInfo = array_merge($customInfo, is_array($this->custom) ? $this->custom : $this->custom->toArray()); } foreach ($configs as &$config) { if ((int)($config['style'] ?? 0) === 0) { $config = PsMethodClass::applyCustomHomeRule($config, $customInfo); } } unset($config); } // 今日已收过附加费时,前端不再展示门槛提示(每日每客户每配送方式只收一次) $customId = (int)($this->customId ?? 0); if ($customId > 0) { foreach ($configs as &$config) { $style = (int)($config['style'] ?? 0); $unMeet = (int)($config['unMeet'] ?? 0); $hasPaidSendCost = PsMethodClass::isSendCostPaidToday($customId, $style); $hasPaidPackCost = PsMethodClass::isPackPaidToday($customId, $style); if ($unMeet === 0 && $hasPaidSendCost) { $config['minAmount'] = 0; $config['minNum'] = 0; $config['unMeetFee'] = 0; } elseif ($unMeet === 2 && $hasPaidPackCost) { $config['minAmount'] = 0; $config['minNum'] = 0; $config['unMeetFee'] = 0; } } unset($config); } util::success(['method' => $configs]); } catch (\Exception $e) { util::fail($e->getMessage()); } } }