Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
01fc2591
Commit
01fc2591
authored
Jan 02, 2019
by
wwccw0591
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
2f9f5f74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
74 deletions
+0
-74
OrderConfirmUtil.php
application/library/Order/OrderConfirmUtil.php
+0
-74
No files found.
application/library/Order/OrderConfirmUtil.php
View file @
01fc2591
...
...
@@ -746,80 +746,6 @@ class OrderConfirmUtil {
return
array
(
'needPayFlag'
=>
$needPayFlag
,
'paySn'
=>
$paySn
);
}
/**
* 获取小程序表单
* User: King <358887571@qq.com>
* Date: 2018/12/27 0027
* Time: 下午 3:15
*/
private
function
getLitAccesstoken
(){
$model_wx
=
\DAO\MbWxModel
::
getInstance
();
$weixin
=
$model_wx
->
getOne
(
'id,lit_appid,lit_appsecret,lit_accesstoken,lit_expirestime'
,
'id=1'
);
$access_token
=
''
;
if
(
!
$weixin
[
'lit_expirestime'
]
||
$weixin
[
'lit_expirestime'
]
<
time
())
{
$access_info
=
json_decode
(
file_get_contents
(
'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='
.
$weixin
[
'lit_appid'
]
.
'&secret='
.
$weixin
[
'lit_appsecret'
]),
true
);
if
(
isset
(
$access_info
[
'access_token'
]))
{
$access_token
=
$access_info
[
'access_token'
];
$update_data
=
array
();
$update_data
[
'lit_accesstoken'
]
=
$access_info
[
'access_token'
];
$update_data
[
'lit_expirestime'
]
=
TIMESTAMP
+
$access_info
[
'expires_in'
]
-
1800
;
$where
=
array
(
'id'
=>
$weixin
[
'id'
]);
$result
=
$model_wx
->
update
(
$update_data
,
$where
);
}
}
else
{
$access_token
=
$weixin
[
'lit_accesstoken'
];
}
return
$access_token
;
}
/**
* curl请求
* @param $url
* @param $access_token
* @param $data
* @param $method
*/
private
function
sendurl
(
$url
,
$access_token
=
''
,
$data
=
''
,
$method
=
'get'
,
$header
=
''
)
{
//
if
(
strtolower
(
$method
)
==
'post'
)
{
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_URL
,
$url
.
$access_token
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYPEER
,
FALSE
);
curl_setopt
(
$curl
,
CURLOPT_SSL_VERIFYHOST
,
FALSE
);
}
else
{
$curl
=
curl_init
(
$url
.
$access_token
);
}
if
(
$header
){
//设置头部信息
curl_setopt
(
$curl
,
CURLOPT_HTTPHEADER
,
$header
);
}
//$curl = curl_init($url.$access_token);
curl_setopt
(
$curl
,
CURLOPT_FAILONERROR
,
1
);
//设置允许页面重定向
curl_setopt
(
$curl
,
CURLOPT_FOLLOWLOCATION
,
1
);
//设置返回值赋给变量
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
1
);
//设置操作时间
curl_setopt
(
$curl
,
CURLOPT_TIMEOUT
,
5
);
if
(
$method
==
'post'
){
if
(
!
$data
)
$data
=
''
;
// 使用post 请求
curl_setopt
(
$curl
,
CURLOPT_POST
,
1
);
// 设置请求参数
curl_setopt
(
$curl
,
CURLOPT_POSTFIELDS
,
$data
);
}
//开始事务
$r
=
curl_exec
(
$curl
);
curl_close
(
$curl
);
return
$r
;
}
public
function
pushMessage
(){
if
(
$this
->
pushMessageOrders
){
$orderService
=
\Business\Order\OrderServiceModel
::
getInstance
();
...
...
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