<?php
 namespace Payment\Common\Weixin\Data\Query; use Payment\Common\PayException; use Payment\Common\Weixin\Data\WxBaseData; use Payment\Utils\ArrayUtil; class RedQueryData extends WxBaseData { protected function buildData() { if($this->submch){ $appid = $this->sub_appid; $mchid = $this->sub_mch_id; }else{ $appid = $this->appId; $mchid = $this->mchId; } $appid = $this->appId; $mchid = $this->mchId; $this->retData = [ 'appid' => $appid, 'mch_id' => $mchid, 'nonce_str' => $this->nonceStr, 'mch_billno'=> $this->mch_billno, 'bill_type' => $this->bill_type, ]; $this->retData = ArrayUtil::paraFilter($this->retData); } protected function checkDataParam() { $orderNo = $this->mch_billno; $billType = $this->bill_type; if (empty($orderNo) && empty($billType)) { throw new PayException('查询红包记录  必须提供商户订单号、订单类型'); } } } 