| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE `wx_card_info` | |||
| ADD COLUMN `rate_amount` int(11) NULL DEFAULT NULL COMMENT '分账通道费差(分账完结时使用)' after `remaining_share_fee_amount`; | |||
| @@ -127,7 +127,7 @@ public class CouponOrderExpiringSchedule { | |||
| } | |||
| if (co.getAutoRefund().equals(EnumCouponAutoRefund.UNSUPPORTED.getCode())){ | |||
| // 微信分账 | |||
| // 不设退款,只能走微信分账-分账完结,把钱给分给商场 | |||
| try { | |||
| WxPayOrder wxPayOrder = new WxPayOrder(); | |||
| wxPayOrder.setTenantId(co.getTenantId()); | |||
| @@ -145,7 +145,13 @@ public class CouponOrderExpiringSchedule { | |||
| wxSharingOrderDto.setPayTimeEnd(wxPayOrder.getPayTimeEnd()); | |||
| wxSharingOrderDto.setTenantId(wxPayOrder.getTenantId()); | |||
| wxSharingOrderDto.setTransactionId(wxPayOrder.getTransactionId()); | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()); | |||
| if (wxPayOrder.getRateAmount() != null) { | |||
| // 实际分账金额为 分账金额 + 通道费差 | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()+wxPayOrder.getRateAmount()); | |||
| } else { | |||
| // 未设置通道费差 | |||
| wxSharingOrderDto.setShareAmount(wxPayOrder.getShareAmount()); | |||
| } | |||
| wxProfitSharingOrderService.finishSharingOrder(wxSharingOrderDto); | |||
| } | |||
| @@ -23,6 +23,8 @@ public class WxSharingOrderDto implements Serializable { | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账金额(总金额扣除手续费后的金额)",name="shareAmount") | |||
| private Integer shareAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账通道费差()",name="rateAmount") | |||
| private Integer rateAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付发起时间",name="payTimeStart") | |||
| private Date payTimeStart; | |||
| @@ -40,6 +40,8 @@ public class WxCardInfo implements Serializable { | |||
| private Integer shareFeeAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账剩余总金额",name="remainingShareFeeAmount") | |||
| private Integer remainingShareFeeAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账通道费差(购买时刻的通道费差,分账完结时使用)",name="rateAmount") | |||
| private Integer rateAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| @@ -60,6 +62,7 @@ public class WxCardInfo implements Serializable { | |||
| ,ServiceFeeAmount_ASC("`service_fee_amount` ASC"),ServiceFeeAmount_DESC("`service_fee_amount` DESC") | |||
| ,ShareFeeAmount_ASC("`share_fee_amount` ASC"),ShareFeeAmount_DESC("`share_fee_amount` DESC") | |||
| ,RemainingShareFeeAmount_ASC("`remaining_share_fee_amount` ASC"),RemainingShareFeeAmount_DESC("`remaining_share_fee_amount` DESC") | |||
| ,RateAmount_ASC("`rate_amount` ASC"),RateAmount_DESC("`rate_amount` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_date` DESC") | |||
| ; | |||
| @@ -39,6 +39,8 @@ public class WxPayAccount implements Serializable { | |||
| private Integer share; | |||
| @io.swagger.annotations.ApiModelProperty(value="手续费(万分之几,默认60)",name="rate") | |||
| private Integer rate; | |||
| @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate") | |||
| private Integer realRate; | |||
| public String getPayNotifyUrl() { | |||
| return notifyUrl + "/pay"; | |||
| @@ -46,9 +48,6 @@ public class WxPayAccount implements Serializable { | |||
| public String getRefundNotifyUrl() { | |||
| return notifyUrl + "/refund"; | |||
| } | |||
| public String getSeparateNotifyUrl() { | |||
| return notifyUrl + "/separate"; | |||
| } | |||
| public String getSubsidyNotifyUrl() { | |||
| return notifyUrl + "/subsidyPay"; | |||
| } | |||
| @@ -66,6 +65,7 @@ public class WxPayAccount implements Serializable { | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||
| ,Rate_ASC("`rate` ASC"),Rate_DESC("`rate` DESC") | |||
| ,RealRate_ASC("`real_rate` ASC"),RealRate_DESC("`real_rate` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -43,6 +43,8 @@ public class WxPayAccountBill implements Serializable { | |||
| private boolean share; | |||
| @io.swagger.annotations.ApiModelProperty(value="手续费(万分之几,默认60)",name="rate") | |||
| private Integer rate; | |||
| @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate") | |||
| private Integer realRate; | |||
| @io.swagger.annotations.ApiModelProperty(value="接收账户名",name="bankAccountName") | |||
| private String bankAccountName; | |||
| @@ -55,9 +57,6 @@ public class WxPayAccountBill implements Serializable { | |||
| public String getRefundNotifyUrl() { | |||
| return notifyUrl + "/refund"; | |||
| } | |||
| public String getSeparateNotifyUrl() { | |||
| return notifyUrl + "/separate"; | |||
| } | |||
| public static enum Field | |||
| @@ -72,6 +71,7 @@ public class WxPayAccountBill implements Serializable { | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||
| ,Rate_ASC("`rate` ASC"),Rate_DESC("`rate` DESC") | |||
| ,RealRate_ASC("`real_rate` ASC"),RealRate_DESC("`real_rate` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -58,6 +58,8 @@ public class WxPayOrder implements Serializable { | |||
| private Integer share; | |||
| @io.swagger.annotations.ApiModelProperty(value="分账金额(总金额扣除手续费后的金额)",name="shareAmount") | |||
| private Integer shareAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="通道费差(购买时刻的通道费差,分账完结时使用)",name="rateAmount") | |||
| private Integer rateAmount; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason") | |||
| private String failReason; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:callback, 1:query)",name="payEndFrom") | |||
| @@ -84,6 +86,7 @@ public class WxPayOrder implements Serializable { | |||
| ,PayOrderStatus_ASC("`pay_order_status` ASC"),PayOrderStatus_DESC("`pay_order_status` DESC") | |||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||
| ,ShareAmount_ASC("`share_amount` ASC"),ShareAmount_DESC("`share_amount` DESC") | |||
| ,RateAmount_ASC("`rate_amount` ASC"),RateAmount_DESC("`rate_amount` DESC") | |||
| ,FailReason_ASC("`fail_reason` ASC"),FailReason_DESC("`fail_reason` DESC") | |||
| ,PayEndFrom_ASC("`pay_end_from` ASC"),PayEndFrom_DESC("`pay_end_from` DESC") | |||
| ; | |||
| @@ -498,7 +498,7 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| cardSpend.setCardBeforeAmount(cardInfo.getRemainingAmount()); | |||
| cardSpend.setCardRemainAmount(0); | |||
| cardSpend.setCardBeforeRealAmount(cardInfo.getRemainingShareFeeAmount()); | |||
| cardSpend.setCardRemainRealAmount(cardInfo.getRemainingShareFeeAmount()); | |||
| cardSpend.setCardRemainRealAmount(0); | |||
| cardSpend.setCreateDate(curDate); | |||
| cardSpend.setUpdateDate(curDate); | |||
| try { | |||
| @@ -523,7 +523,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||
| shareOrder.setOrderId(cardSpend.getId()); | |||
| shareOrder.setPayAmount(0); | |||
| shareOrder.setOrderId(cardSpend.getId()); | |||
| shareOrder.setShareAmount(cardInfo.getRemainingShareFeeAmount()); | |||
| if(cardInfo.getRateAmount() != null) { | |||
| // 分账实际金额 = 分账实际剩余金额 + 通道费差 | |||
| shareOrder.setShareAmount(cardInfo.getRemainingShareFeeAmount()+cardInfo.getRateAmount()); | |||
| } else { | |||
| shareOrder.setShareAmount(cardInfo.getRemainingShareFeeAmount()); | |||
| } | |||
| shareOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI_FINISH.getCode()); | |||
| profitSharingOrderService.finishSharingOrder(shareOrder); | |||
| } | |||
| @@ -420,6 +420,7 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| wxSharingOrderDto.setMerchantId(merchantId); | |||
| wxSharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | |||
| wxSharingOrderDto.setPayAmount(wxPayOrder.getPayAmount()); | |||
| wxSharingOrderDto.setRateAmount(wxPayOrder.getRateAmount()); | |||
| wxSharingOrderDto.setOrderId(wxPayOrder.getId()); | |||
| wxSharingOrderDto.setPayTimeStart(wxPayOrder.getPayTimeStart()); | |||
| wxSharingOrderDto.setPayTimeEnd(wxPayOrder.getPayTimeEnd()); | |||
| @@ -531,6 +531,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| cardInfo.setServiceFeeAmount(fee); | |||
| cardInfo.setShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRemainingShareFeeAmount(payOrder.getShareAmount()); | |||
| cardInfo.setRateAmount(payOrder.getRateAmount()); | |||
| cardInfo.setCreateDate(curr); | |||
| cardInfo.setUpdateDate(curr); | |||
| cardInfo.setSupportTransfer(coupon.getSupportTransfer()); | |||
| @@ -983,6 +984,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||
| sharingOrder.setMerchantId(wxMerchantBUser.getMerchantId()); | |||
| sharingOrder.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | |||
| sharingOrder.setPayAmount(wxPayOrder.getPayAmount()); | |||
| sharingOrder.setRateAmount(wxPayOrder.getRateAmount()); | |||
| sharingOrder.setOrderId(wxPayOrder.getId()); | |||
| sharingOrder.setPayTimeStart(wxPayOrder.getPayTimeStart()); | |||
| sharingOrder.setPayTimeEnd(wxPayOrder.getPayTimeEnd()); | |||
| @@ -219,6 +219,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| int iChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRate()); | |||
| Integer share_amount = record.getPayAmount() - iChargeFee; | |||
| record.setShareAmount(share_amount); | |||
| if(payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRealRate()); | |||
| if(iChargeFee > iRealChargeFee) { | |||
| record.setRateAmount(iChargeFee - iRealChargeFee); | |||
| } | |||
| } | |||
| } | |||
| int sqlRow = wxPayOrderMapper.insertSelective(record); | |||
| @@ -416,20 +422,6 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| isShare = EnumPayShare.YES; | |||
| } | |||
| /*进入分账,待分账时再判断是否存在对应的分账账户 | |||
| // 1.5 check 分账 receive | |||
| if (isShare == EnumPayShare.YES) { | |||
| WxProfitSharingReceiver receiver = new WxProfitSharingReceiver(); | |||
| receiver.setMerchantId(order.getMerchantId()); | |||
| List<WxProfitSharingReceiver> merList = wxProfitSharingReceiverMapper.findList(receiver); | |||
| if (merList.size() > 0) { | |||
| isShare = EnumPayShare.YES; | |||
| } else { | |||
| isShare = EnumPayShare.NO; | |||
| } | |||
| } | |||
| */ | |||
| // 2. check 是否有支付订单 | |||
| Date currentDate = new Date(); | |||
| record.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||
| @@ -458,6 +450,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||
| int iChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRate()); | |||
| Integer share_amount = record.getPayAmount() - iChargeFee; | |||
| record.setShareAmount(share_amount); | |||
| if(payAccount.getRealRate() != null) { | |||
| int iRealChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRealRate()); | |||
| record.setRateAmount(iRealChargeFee); | |||
| } | |||
| if (share_amount <= 0) { | |||
| isShare = EnumPayShare.NO; | |||
| record.setShare(isShare.getCode()); | |||
| @@ -263,7 +263,10 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ | |||
| sharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE_FINISH.getCode()); | |||
| if (sharingOrderDto.getType().equals(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode())) | |||
| return new ResultData(ErrorCode.PROFIT_SHARING_RECEIVER_UNKNOWN); | |||
| if(sharingOrderDto.getRateAmount() != null) { | |||
| // 分账完结 | |||
| sharingOrderDto.setShareAmount(sharingOrderDto.getPayAmount()+sharingOrderDto.getRateAmount()); | |||
| } | |||
| return finishSharingOrder(sharingOrderDto); | |||
| } | |||
| @@ -12,6 +12,7 @@ | |||
| <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" /> | |||
| <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" /> | |||
| <result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" /> | |||
| <result column="rate_amount" jdbcType="INTEGER" property="rateAmount" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/> | |||
| @@ -19,8 +20,10 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`coupon_id`,`transaction_id`,`amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`, | |||
| `share_fee_amount`,`remaining_share_fee_amount`,`create_date`,`update_date`,`support_transfer` | |||
| `id`,`tenant_id`,`coupon_id`,`transaction_id`, | |||
| `amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`, | |||
| `share_fee_amount`,`remaining_share_fee_amount`, `rate_amount`, | |||
| `create_date`,`update_date`,`support_transfer` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -54,7 +57,10 @@ | |||
| </if> | |||
| <if test=" null != remainingShareFeeAmount "> | |||
| and `remaining_share_fee_amount` = #{remainingShareFeeAmount} | |||
| </if> | |||
| </if> | |||
| <if test=" null != rateAmount "> | |||
| and `rate_amount` = #{rateAmount} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| @@ -84,6 +90,7 @@ | |||
| <result column="service_fee_amount" jdbcType="INTEGER" property="serviceFeeAmount" /> | |||
| <result column="share_fee_amount" jdbcType="INTEGER" property="shareFeeAmount" /> | |||
| <result column="remaining_share_fee_amount" jdbcType="INTEGER" property="remainingShareFeeAmount" /> | |||
| <result column="rate_amount" jdbcType="INTEGER" property="rateAmount" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| @@ -112,7 +119,9 @@ | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| ci.`id`,ci.`tenant_id`,ci.`coupon_id`,ci.`transaction_id`,ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`,ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, | |||
| ci.`id`,ci.`tenant_id`,ci.`coupon_id`,ci.`transaction_id`, | |||
| ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`, | |||
| ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, ci.`rate_amount`, | |||
| ci.`create_date`,ci.`update_date`, | |||
| c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`, c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`, | |||
| co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status, | |||
| @@ -151,6 +160,9 @@ | |||
| <if test=" null != remainingShareFeeAmount "> | |||
| and ci.`remaining_share_fee_amount` = #{remainingShareFeeAmount} | |||
| </if> | |||
| <if test=" null != rateAmount "> | |||
| and ci.`rate_amount` = #{rateAmount} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and ci.`create_date` = #{createDate} | |||
| </if> | |||
| @@ -11,12 +11,13 @@ | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="rate" jdbcType="INTEGER" property="rate"/> | |||
| <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | |||
| <result column="bank_account_name" jdbcType="VARCHAR" property="bankAccountName"/> | |||
| <result column="bank_card_id" jdbcType="VARCHAR" property="bankCardId"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate` | |||
| `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -54,6 +55,9 @@ | |||
| <if test=" null != rate "> | |||
| and `rate` = #{rate} | |||
| </if> | |||
| <if test=" null != realRate "> | |||
| and `real_rate` = #{realRate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -11,10 +11,11 @@ | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="rate" jdbcType="INTEGER" property="rate"/> | |||
| <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate` | |||
| `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -52,6 +53,9 @@ | |||
| <if test=" null != rate "> | |||
| and `rate` = #{rate} | |||
| </if> | |||
| <if test=" null != realRate "> | |||
| and `real_rate` = #{realRate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -21,6 +21,7 @@ | |||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/> | |||
| <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | |||
| </resultMap> | |||
| @@ -28,7 +29,7 @@ | |||
| `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`b_user_id`, | |||
| `auth_code`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`, | |||
| `prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`, | |||
| `pay_order_status`,`share`,`share_amount`,`fail_reason` | |||
| `pay_order_status`,`share`,`share_amount`,`rate_amount`,`fail_reason` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -146,6 +147,7 @@ | |||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/> | |||
| <result column="rate_amount" jdbcType="INTEGER" property="rateAmount"/> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | |||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||
| @@ -157,7 +159,7 @@ | |||
| p.`id`,p.`tenant_id`,p.`create_time`,p.`update_time`,p.`order_id`,p.`c_user_id`,p.`b_user_id`, | |||
| p.`auth_code`,p.`ip`,p.`pay_amount`,p.`pay_time_start`,p.`pay_time_end`, | |||
| p.`prepay_id`,p.`transaction_id`,p.`pay_vendor`,p.`pay_order_no`, | |||
| p.`pay_order_status`,p.`share`,p.`share_amount`,p.`fail_reason`, | |||
| p.`pay_order_status`,p.`share`,p.`share_amount`,p.`rate_amount`,p.`fail_reason`, | |||
| u.`open_id`, | |||
| a.`app_id`, a.`pay_id` | |||
| </sql> | |||