rawTradeList, $model->rawTradeOrderList, $model->discountList] = (new CreateOrderService())->flagshipAssembleData($order); $model->shop_no = $config['shop_no']; if (empty($model->rawTradeList)) { return true; } $resp = $req->send($model); if ($resp->getError()) return $resp->getError(); // 执行其他操作 try { $res = $resp->toArray(); if (!isset($res['status']) || $res['status'] != StatusEnum::DISABLED) return $res['message'] ?? var_export($res, true); } catch (\Exception $e) { return $e->getMessage(); } return true; } /** * @param array $config * @param array $order * @return void * @throws \Exception */ protected function flagship(array $config, array $order) { $flag = $this->retry(function () use ($config, $order) { return $this->flagshipSend($config, $order); }); if (is_string($flag)) throw new \Exception($flag); } }