user(); } public function customerId() { return $this->customer()->id; } public function customerShopId() { return $this->customer()->shop_id; } public function getPayTypes() { $channel = ShopPayChannel::where('opened', BoolEnum::YES) ->where('shop_id', $this->customerShopId()) ->where('state', ShopPayChannel::STATE_SUCCESS) ->orderBy('pay_type', 'asc') ->get(); $result = []; foreach ($channel as $item) { $result[] = [ 'id' => $item->id, 'pay_type' => $item->pay_type, 'pay_channel' => $item->pay_channel, 'name' => $item->pay_channel_name, 'wechat_qrcode' => $item->wechat_qrcode_url, 'alipay_qrcode' => $item->alipay_qrcode_url, 'remind_after' => $item->remind_after, 'remind_before' => $item->remind_before, ]; } return $result; } }