Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
7db2d046
Commit
7db2d046
authored
Dec 26, 2019
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ft-oem' into test
parents
d03f6032
7e655e7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
17 deletions
+31
-17
src/Common/Config/CfgCenter.php
+31
-17
No files found.
src/Common/Config/CfgCenter.php
View file @
7db2d046
...
...
@@ -38,7 +38,34 @@ class CfgCenter
}
/**
* 用法同上
* 根据oemId获取支付证书
*
* @param integer $oemId
* @return array
*/
public
static
function
getCertByOemId
(
$keyName
,
int
$oemId
)
{
$dbConn
=
self
::
dbConnect
();
//连接配置库
// 注意,需要返回oemId字段
$result
=
$dbConn
->
get
(
"config"
,
[
'oemId'
,
'certPem'
,
'keyPem'
],
[
'oemId'
=>
$oemId
,
'name'
=>
$keyName
]);
return
$result
;
}
/**
* 根据mchId获取对应的支付配置
*
* @param string $mchId
* @return mixed
*/
public
static
function
getByMchId
(
int
$mchId
)
{
$dbConn
=
self
::
dbConnect
();
//连接配置库
$result
=
$dbConn
->
get
(
"config"
,
[
'value'
],
[
'mchId'
=>
$mchId
]);
$resArr
=
json_decode
(
$result
[
'value'
],
true
);
return
is_array
(
$resArr
)
?
$resArr
:
$result
[
'value'
];
}
/**
* 如果有oemId,尽量使用方法getByOemId()读取配置
* 根据storeId获取所属OEM平台的配置
*
* @param string $keyName
...
...
@@ -53,7 +80,7 @@ class CfgCenter
}
/**
*
用法同上
*
如果有oemId,尽量使用方法getByOemId()读取配置
* 根据sellerId获取所属OEM平台的配置
*
* @param string $keyName
...
...
@@ -68,7 +95,7 @@ class CfgCenter
}
/**
*
用法同上
*
如果有oemId,尽量使用方法getByOemId()读取配置
* 根据unionId获取所属OEM平台的配置
*
* @param string $keyName
...
...
@@ -83,20 +110,7 @@ class CfgCenter
}
/**
* 根据mchId获取对应的支付配置
*
* @param string $mchId
* @return mixed
*/
public
static
function
getByMchId
(
int
$mchId
)
{
$dbConn
=
self
::
dbConnect
();
//连接配置库
$result
=
$dbConn
->
get
(
"config"
,
[
'value'
],
[
'mchId'
=>
$mchId
]);
$resArr
=
json_decode
(
$result
[
'value'
],
true
);
return
is_array
(
$resArr
)
?
$resArr
:
$result
[
'value'
];
}
/**
* 如果有oemId,尽量使用方法getCertByOemId()读取证书
* 根据店铺id获取支付证书
*
* @param integer $storeId
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment