book_config = $this->getBookByProduct($order->product_id); } private function getBookByProduct($product_id) { return BookConfig::where('product_id', $product_id)->first(); } protected function handlePayProcess() { $book_order = []; $book_order['bid'] = isset($this->book_config->bid) ? $this->book_config->bid : ''; $book_order['book_name'] = isset($this->book_config->book_name) ? $this->book_config->book_name : ''; $book_order['uid'] = $this->order->uid; $book_order['distribution_channel_id'] = $this->order->distribution_channel_id; $book_order['fee'] = $this->order->price; $book_order['send_order_id'] = $this->order->send_order_id; return BookOrder::firstOrCreate($book_order); } }