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
716b080d
Commit
716b080d
authored
Jul 24, 2018
by
zhufx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.公共实体增加获取表明方法(Query::Table的时候用)
2.订单错误码更新
parent
3298c078
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
src/Common/Entity/CommonEntity.php
+26
-2
src/Order/Enum/OrderError.php
+7
-0
No files found.
src/Common/Entity/CommonEntity.php
View file @
716b080d
...
...
@@ -58,6 +58,16 @@ class CommonEntity extends Model
}
/**
* 获取分库表明
* @throws Exception
*/
public
static
function
tableName
()
{
$num
=
self
::
getDbNum
();
return
self
::
getTableName
()
.
'_'
.
$num
;
}
/**
* 获取数据库id
* @return int
* @throws Exception
...
...
@@ -75,10 +85,13 @@ class CommonEntity extends Model
}
/**
* 设置表名
* @param $dbNum
*/
private
static
function
setTableName
(
$dbNum
)
{
preg_match
(
'/(?<=Table\(name=").*(?="\))/'
,
self
::
$commentString
,
$matches
);
$tableName
=
isset
(
$matches
[
0
])
?
$matches
[
0
]
:
''
;
$tableName
=
self
::
getTableName
();
EntityCollector
::
collect
(
static
::
class
,
...
...
@@ -86,4 +99,14 @@ class CommonEntity extends Model
);
}
/**
* 获取原始表名
* @return string
*/
private
static
function
getTableName
()
{
preg_match
(
'/(?<=Table\(name=").*(?="\))/'
,
self
::
$commentString
,
$matches
);
return
$tableName
=
isset
(
$matches
[
0
])
?
$matches
[
0
]
:
''
;
}
}
\ No newline at end of file
src/Order/Enum/OrderError.php
View file @
716b080d
...
...
@@ -37,6 +37,13 @@ class OrderError
const
O_CREATE_ERR
=
[
"msg"
=>
"创建订单失败"
,
"code"
=>
500
,
"errorCode"
=>
22110
];
const
O_GOODS_SAVE_ERR
=
[
"msg"
=>
"商品订单存入失败"
,
"code"
=>
500
,
"errorCode"
=>
22111
];
const
O_CUT_PRICE_SAVE_ERR
=
[
"msg"
=>
"砍价订单存入失败"
,
"code"
=>
500
,
"errorCode"
=>
22115
];
const
O_NOT_FOUND
=
[
"msg"
=>
"订单不存在"
,
"code"
=>
404
,
"errorCode"
=>
22116
];
const
O_STATUS_ERR
=
[
"msg"
=>
"订单状态错误,无法操作"
,
"code"
=>
400
,
"errorCode"
=>
22117
];
const
DB_ERROR
=
[
"msg"
=>
"数据库操作错误"
,
"code"
=>
500
,
"errorCode"
=>
22118
];
...
...
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