|
@@ -33,17 +33,22 @@ export class WalletService extends BaseService {
|
|
|
// 商户给自己的用户创建钱包
|
|
|
// 商户给自己创建钱包
|
|
|
|
|
|
+ let customer;
|
|
|
+
|
|
|
if(!param.customer_id) {
|
|
|
// 查找商户的 customer_id
|
|
|
// api访问
|
|
|
// 网页中访问
|
|
|
const { merchant } = this.ctx.admin;
|
|
|
- console.log(41, merchant)
|
|
|
+ customer = await this.customerEntity.findOneBy({
|
|
|
+ merchantId: merchant.mchId,
|
|
|
+ out_user_id: null
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ customer = await this.customerEntity.findOneBy({
|
|
|
+ customer_id: param.customer_id
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
- const customer = await this.customerEntity.findOneBy({
|
|
|
- customer_id: param.customer_id
|
|
|
- });
|
|
|
if (!customer) {
|
|
|
throw new CoolCommException('客户不存在,请先创建认证');
|
|
|
}
|
|
@@ -133,7 +138,8 @@ export class WalletService extends BaseService {
|
|
|
console.log('getWallet',param)
|
|
|
// TODO setChannel 需要调整为动态的
|
|
|
const res = await this.paymentService.setChannel('SUNPAY').getWallet({
|
|
|
- customer_id: param,
|
|
|
+ // customer_id: param,
|
|
|
+ ...param
|
|
|
});
|
|
|
return res;
|
|
|
}
|