request->param(); if (empty($param['market_type'])) { $result = [ 'code' => 0, 'message' => 'SUCCESS', 'data' => ['total' => 0, 'list' => [], 'extent' => StockMarketModel::STOCK_MARKET_TYPE] ]; return json($result); } $result = (new GiveStockService)->index($param['market_type'], $param, $this->getAdminId()); return json($result); } catch (\Exception $exception) { return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage()]); } } // 新增 public function add() { try { $param = $this->request->param(); if (empty($param['market_type'])) return json([]); $result = (new GiveStockService)->add($param['market_type'], $param); return json($result); } catch (\Exception $exception) { return $this->toData('0', 'The system is busy. Please try again later.', [$exception->getMessage()]); } } }