123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Client\Pay;
- use App\Modules\Book\Services\BookConfigService;
- use App\Modules\Subscribe\Models\BookOrder;
- use App\Modules\Subscribe\Models\Order;
- class BookOrderPaySuccess extends PaySuccessAbstract
- {
- private $book_order;
- public function __construct(Order $order)
- {
- parent::__construct($order);
- $book_conf = BookConfigService::getBookByProduct($order->product_id);
- $this->book_order = [];
- $this->book_order['bid'] = isset($book_conf->bid) ? $book_conf->bid : '';
- $this->book_order['book_name'] = isset($book_conf->book_name) ? $book_conf->book_name : '';
- $this->book_order['uid'] = $order->uid;
- $this->book_order['distribution_channel_id'] = $order->distribution_channel_id;
- $this->book_order['fee'] = $order->price;
- $this->book_order['send_order_id'] = $order->send_order_id;
- $this->book_order['charge_balance'] = 0;
- $this->book_order['reward_balance'] = 0;
- }
- protected function handlePayProcess()
- {
- return BookOrder::firstOrCreate($this->book_order);
- }
- }
|