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
4324bbf6
Commit
4324bbf6
authored
Nov 05, 2018
by
xmy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
c664748d
45501901
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
4 deletions
+52
-4
UPGRADE.md
+9
-0
src/Common/Entity/CommonEntity.php
+30
-3
src/Common/Entity/Split.php
+1
-1
src/Store/Lib/StoreInterface.php
+12
-0
No files found.
UPGRADE.md
0 → 100644
View file @
4324bbf6
# 1.0.5
-
新增版本更新日志文件
# 1.0.4
-
新加根据卖家ID列表 批量获取店铺列表的RPC接口
# 1.0.3
-
修改数据库公共实体,调整getTableName方法
src/Common/Entity/CommonEntity.php
View file @
4324bbf6
...
...
@@ -103,13 +103,40 @@ class CommonEntity extends Model
$dbNum
=
self
::
getDbNum
();
$tableName
=
self
::
getTableName
(
$commentString
)
.
'_'
.
$dbNum
;
//self::setTableName($tableName);
return
$tableName
;
}
else
{
return
self
::
getTableName
();
$tableName
=
self
::
getTableName
(
$commentString
);
}
$newTableName
=
self
::
newTableName
();
if
(
$tableName
!=
$newTableName
)
{
//校验新的分表规则
App
::
error
(
"[新分表异常][对比失败]oldFunction"
.
$tableName
.
'new function'
.
$newTableName
);
var_dump
(
"[新分表异常][对比失败]oldFunction"
.
$tableName
.
'new function'
.
$newTableName
);
}
return
$tableName
;
}
private
static
function
newTableName
()
{
if
(
empty
(
RequestContext
::
getContextData
())
)
{
//初始化不做处理
return
;
}
$entityCollector
=
EntityCollector
::
getCollector
();
$splitCollector
=
SplitCollector
::
getCollector
();
//分表搜集器
$className
=
static
::
class
;
$tableName
=
$entityCollector
[
$className
][
'table'
][
'name'
];
if
(
isset
(
$splitCollector
[
$className
])
)
{
//分表
$dbNum
=
(
new
Split
())
->
getDbNum
(
$className
);
$tableName
=
$tableName
.
'_'
.
$dbNum
;
}
return
$tableName
;
}
/**
...
...
src/Common/Entity/Split.php
View file @
4324bbf6
...
...
@@ -58,7 +58,7 @@ class Split
return
$tableName
;
}
p
rivate
function
getDbNum
(
$className
)
p
ublic
function
getDbNum
(
$className
)
{
$splitCollector
=
SplitCollector
::
getCollector
();
$splitNum
=
$splitCollector
[
$className
][
'num'
];
...
...
src/Store/Lib/StoreInterface.php
View file @
4324bbf6
...
...
@@ -19,6 +19,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferIsNormal(int $storeId)
* @method ResultInterface deferGetStoreByStoreId(int $storeId)
* @method ResultInterface deferGetStoreBySellerId(int $sellerId)
* @method ResultInterface deferGetListBySellerIds(array $sellerIds)
* @method ResultInterface deferGetStoreByMobile(int $mobile, array $fields = [])
* @method ResultInterface deferUpdateStore(int $storeId, array $data)
* @method ResultInterface deferDeleteStore(int $storeId)
...
...
@@ -59,6 +60,17 @@ interface StoreInterface
public
function
getStoreBySellerId
(
int
$sellerId
);
/**
* 根据卖家ID列表获取店铺信息列表
*
* @param array $sellerIds
* @return array
* sellerName 卖家姓名
* mobile 注册手机号
* edition 是否VIP 2 表示是VIP
*/
public
function
getListBySellerIds
(
array
$sellerIds
);
/**
* 根据注册手机号获取店铺信息
*
* @param integer $mobile
...
...
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