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
ae2eaf20
Commit
ae2eaf20
authored
Oct 24, 2018
by
feixiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取表明支持任意分表数量
parent
db9686dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/Common/Entity/CommonEntity.php
+6
-4
No files found.
src/Common/Entity/CommonEntity.php
View file @
ae2eaf20
...
...
@@ -7,6 +7,7 @@
*/
namespace
Hdll\Services\Common\Entity
;
use
Hdll\Services\Common\Bean\Collector\SplitCollector
;
use
Swoft\App
;
use
Swoft\Core\RequestContext
;
use
Swoft\Db\Bean\Collector\EntityCollector
;
...
...
@@ -78,7 +79,7 @@ class CommonEntity extends Model
/**
* 获取分库表名
*
* @return string
|void
* @return string
* @throws Exception
* @throws \ReflectionException
*/
...
...
@@ -89,8 +90,6 @@ class CommonEntity extends Model
return
;
}
$request
=
RequestContext
::
getRequest
();
//获取注解里的table
$res
=
new
\ReflectionClass
(
static
::
class
);
$commentString
=
$res
->
getDocComment
();
...
...
@@ -127,7 +126,10 @@ class CommonEntity extends Model
throw
new
Exception
(
"店铺id获取失败"
);
}
return
$store
%
100
;
$splitCollector
=
SplitCollector
::
getCollector
();
$splitNum
=
$splitCollector
[
static
::
class
][
'num'
];
return
$store
%
$splitNum
;
}
...
...
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