Commit 4324bbf6 by xmy

Merge remote-tracking branch 'origin/master'

parents c664748d 45501901
# 1.0.5
- 新增版本更新日志文件
# 1.0.4
- 新加根据卖家ID列表 批量获取店铺列表的RPC接口
# 1.0.3
- 修改数据库公共实体,调整getTableName方法
......@@ -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;
}
/**
......
......@@ -58,7 +58,7 @@ class Split
return $tableName;
}
private function getDbNum($className)
public function getDbNum($className)
{
$splitCollector = SplitCollector::getCollector();
$splitNum = $splitCollector[$className]['num'];
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment