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
8bfee942
Commit
8bfee942
authored
Aug 29, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志写入
parent
2e4fd0e5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
6 deletions
+25
-6
Common.php
application/controllers/Common.php
+11
-0
ArrayConst.php
application/library/Our/ArrayConst.php
+2
-1
DescribeConst.php
application/library/Our/DescribeConst.php
+2
-0
Log.php
application/library/Our/Log.php
+4
-4
NameConst.php
application/library/Our/NameConst.php
+3
-0
CodeConfig.php
application/models/Error/CodeConfig.php
+3
-1
No files found.
application/controllers/Common.php
View file @
8bfee942
...
@@ -68,4 +68,15 @@ class CommonController extends \Our\Controller_AbstractIndex{
...
@@ -68,4 +68,15 @@ class CommonController extends \Our\Controller_AbstractIndex{
$articleList
=
$commonProbleService
->
getProblemList
(
true
);
$articleList
=
$commonProbleService
->
getProblemList
(
true
);
$this
->
success
(
$articleList
);
$this
->
success
(
$articleList
);
}
}
public
function
logAction
(){
$logContent
=
trim
(
$this
->
req
[
\Our\NameConst
::
data
][
'content'
]);
if
(
!
$logContent
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyLog
);
}
$log
=
\Our\Log
::
getInstance
();
// $log->write(print_r($data, true));
$log
->
write
(
$logContent
,
\Our\NameConst
::
frontLogPath
);
$this
->
success
(
new
stdClass
(),
\Our\DescribeConst
::
logWriteSuccess
,
\Our\DescribeConst
::
logWriteSuccess
);
}
}
}
\ No newline at end of file
application/library/Our/ArrayConst.php
View file @
8bfee942
...
@@ -58,7 +58,8 @@ class ArrayConst
...
@@ -58,7 +58,8 @@ class ArrayConst
const
defaultAddress
=
array
(
const
defaultAddress
=
array
(
NameConst
::
cityCode
=>
'0591'
,
NameConst
::
cityCode
=>
'0591'
,
NameConst
::
lat
=>
'26.053183'
,
NameConst
::
lat
=>
'26.053183'
,
NameConst
::
lng
=>
'119.24174'
NameConst
::
lng
=>
'119.24174'
,
NameConst
::
address
=>
'横一号路特力林科技大厦'
);
);
//小程序账号
//小程序账号
...
...
application/library/Our/DescribeConst.php
View file @
8bfee942
...
@@ -86,6 +86,8 @@ class DescribeConst
...
@@ -86,6 +86,8 @@ class DescribeConst
const
paySuccessTips
=
'支付成功'
;
const
paySuccessTips
=
'支付成功'
;
const
paySuccessSubTips
=
'感谢您的购买'
;
const
paySuccessSubTips
=
'感谢您的购买'
;
const
logWriteSuccess
=
'日志写入成功'
;
//支付方式描述
//支付方式描述
const
offPay
=
'线下支付'
;
const
offPay
=
'线下支付'
;
const
wxPay
=
'微信支付'
;
const
wxPay
=
'微信支付'
;
...
...
application/library/Our/Log.php
View file @
8bfee942
...
@@ -14,8 +14,8 @@ class Log {
...
@@ -14,8 +14,8 @@ class Log {
*
*
* @param string $message
* @param string $message
*/
*/
public
function
write
(
$message
)
{
public
function
write
(
$message
,
$filePath
=
'/data/log/application'
)
{
fwrite
(
$this
->
getHandle
(),
date
(
"Y-m-d H:i:s"
)
fwrite
(
$this
->
getHandle
(
$filePath
),
date
(
"Y-m-d H:i:s"
)
.
"
\t
"
.
$message
.
"
\t
"
.
$message
.
"
\t
uri:"
.
$_SERVER
[
'REQUEST_URI'
]
.
"
\t
uri:"
.
$_SERVER
[
'REQUEST_URI'
]
.
"
\t
ref:"
.
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
''
)
.
"
\t
ref:"
.
(
isset
(
$_SERVER
[
'HTTP_REFERER'
])
?
$_SERVER
[
'HTTP_REFERER'
]
:
''
)
...
@@ -27,9 +27,9 @@ class Log {
...
@@ -27,9 +27,9 @@ class Log {
*
*
* @return
* @return
*/
*/
public
function
getHandle
()
{
public
function
getHandle
(
$filePath
=
'/data/log/application'
)
{
if
(
!
$this
->
_handle
)
{
if
(
!
$this
->
_handle
)
{
$this
->
_handle
=
fopen
(
APPLICATION_PATH
.
'/data/log/application'
.
date
(
'Ymd'
)
.
'.log'
,
'a'
);
$this
->
_handle
=
fopen
(
APPLICATION_PATH
.
$filePath
.
date
(
'Ymd'
)
.
'.log'
,
'a'
);
}
}
return
$this
->
_handle
;
return
$this
->
_handle
;
...
...
application/library/Our/NameConst.php
View file @
8bfee942
...
@@ -70,6 +70,7 @@ class NameConst {
...
@@ -70,6 +70,7 @@ class NameConst {
const
cityCode
=
'cityCode'
;
const
cityCode
=
'cityCode'
;
const
lat
=
'lat'
;
const
lat
=
'lat'
;
const
lng
=
'lng'
;
const
lng
=
'lng'
;
const
address
=
'address'
;
const
wechatAuthUrl
=
'https://api.weixin.qq.com/sns/jscode2session?'
;
const
wechatAuthUrl
=
'https://api.weixin.qq.com/sns/jscode2session?'
;
...
@@ -156,6 +157,8 @@ class NameConst {
...
@@ -156,6 +157,8 @@ class NameConst {
const
cancelUnPayedOrderTimePrefix
=
'cancelUnPayedOrderTime'
;
const
cancelUnPayedOrderTimePrefix
=
'cancelUnPayedOrderTime'
;
const
cancelUnReceivedOrderTimePrefix
=
'cancelUnReceivedOrderTime'
;
const
cancelUnReceivedOrderTimePrefix
=
'cancelUnReceivedOrderTime'
;
const
frontLogPath
=
'/data/log/front'
;
}
}
?>
?>
\ No newline at end of file
application/models/Error/CodeConfig.php
View file @
8bfee942
...
@@ -90,6 +90,7 @@ class CodeConfigModel {
...
@@ -90,6 +90,7 @@ class CodeConfigModel {
const
updateMobileMembmerMappingFailed
=
10077
;
const
updateMobileMembmerMappingFailed
=
10077
;
const
currentMobileHasBeenBind
=
10078
;
const
currentMobileHasBeenBind
=
10078
;
const
otherDriverLogin
=
10105
;
const
otherDriverLogin
=
10105
;
const
emptyLog
=
10106
;
//访问错误
//访问错误
const
illegalAccess
=
200001
;
const
illegalAccess
=
200001
;
...
@@ -745,7 +746,8 @@ class CodeConfigModel {
...
@@ -745,7 +746,8 @@ class CodeConfigModel {
self
::
updateMobileMembmerMappingFailed
=>
'更新手机号码对应会员mapping信息失败'
,
self
::
updateMobileMembmerMappingFailed
=>
'更新手机号码对应会员mapping信息失败'
,
self
::
currentMobileHasBeenBind
=>
'当前手机号码已经绑定其他微信,如需绑定,请先手机号码登录app进行微信解绑'
,
self
::
currentMobileHasBeenBind
=>
'当前手机号码已经绑定其他微信,如需绑定,请先手机号码登录app进行微信解绑'
,
self
::
otherDriverLogin
=>
'当前用户已被其他设备登录,请重新登录'
,
self
::
otherDriverLogin
=>
'当前用户已被其他设备登录,请重新登录'
,
self
::
elasticsError
=>
'全文索引连接出错'
self
::
elasticsError
=>
'全文索引连接出错'
,
self
::
emptyLog
=>
'日志内容不能为空'
);
);
}
}
...
...
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