Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
bp
goods
Commits
4de2f7d3
Commit
4de2f7d3
authored
Jun 25, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:异常错误码整理
parent
363dc8cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
BaseException.php
application/exception/BaseException.php
+8
-2
Code.php
application/exception/custom/Code.php
+5
-5
No files found.
application/exception/BaseException.php
View file @
4de2f7d3
...
@@ -27,13 +27,19 @@ class BaseException extends \Exception
...
@@ -27,13 +27,19 @@ class BaseException extends \Exception
}
}
$this
->
code
=
$params
[
'code'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
code
;
$this
->
code
=
$params
[
'code'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
code
;
$this
->
msg
=
$params
[
'msg'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
msg
;
$this
->
msg
=
$params
[
'msg'
]
??
Registry
::
get
(
'config'
)
->
exception
->
user
->
msg
;
if
(
isset
(
$params
[
'cus'
])
&&
$this
->
cus
&&
isset
(
$this
->
cus
[
intval
(
$params
[
'cus'
])])
&&
$this
->
base_code
)
{
if
(
isset
(
$params
[
'cus'
])
&&
$this
->
cus
&&
isset
(
$this
->
cus
[
intval
(
$params
[
'cus'
])])
&&
$this
->
base_code
)
{
//每个服务都有自己的codePrefix
$appid
=
\Yaf\Application
::
app
()
->
getConfig
()
->
get
(
"appid"
);
$codePrefix
=
\Yaconf
::
get
(
'bizcode.prefix.'
.
$appid
);
$codePrefix
=
intval
(
$codePrefix
);
$cus_code
=
intval
(
$params
[
'cus'
]);
$cus_code
=
intval
(
$params
[
'cus'
]);
$base_code
=
intval
(
$this
->
base_code
);
$base_code
=
intval
(
$this
->
base_code
);
$this
->
code
=
$base_code
+
$cus_code
;
$this
->
code
=
$
codePrefix
+
$
base_code
+
$cus_code
;
$this
->
msg
=
$this
->
cus
[
$cus_code
];
$this
->
msg
=
$this
->
cus
[
$cus_code
];
}
}
}
}
...
...
application/exception/custom/Code.php
View file @
4de2f7d3
...
@@ -13,10 +13,10 @@ class Code
...
@@ -13,10 +13,10 @@ class Code
{
{
const
PARAM
=
101000
;
const
PARAM
=
101000
;
const
SIGN
=
102000
;
const
SIGN
=
102000
;
const
GOODS
=
1
08
000
;
const
GOODS
=
1
10
000
;
const
SHOP
=
1
09
000
;
const
SHOP
=
1
20
000
;
const
DISTRIBUTOR
=
1
1
0000
;
const
DISTRIBUTOR
=
1
3
0000
;
const
DISTRIBUTION
=
1
11
000
;
const
DISTRIBUTION
=
1
40
000
;
const
MARKETING
=
1
12
000
;
const
MARKETING
=
1
50
000
;
}
}
\ No newline at end of file
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