Commit c090b428 by feixiang

未获取店铺信息,抛出异常

parent a2b64118
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Hdll\Services\Common\Entity; namespace Hdll\Services\Common\Entity;
use Hdll\Services\Common\Bean\Collector\SplitCollector; use Hdll\Services\Common\Bean\Collector\SplitCollector;
use Hdll\Services\Common\Exception\CommonException;
use Swoft\Core\RequestContext; use Swoft\Core\RequestContext;
use Swoft\Db\Bean\Collector\EntityCollector; use Swoft\Db\Bean\Collector\EntityCollector;
use Swoft\Db\QueryBuilder; use Swoft\Db\QueryBuilder;
...@@ -57,6 +58,9 @@ class Split ...@@ -57,6 +58,9 @@ class Split
$splitNum = $splitCollector[$className]['num']; $splitNum = $splitCollector[$className]['num'];
$data = RequestContext::getContextData(); $data = RequestContext::getContextData();
$storeId = $data['userInfo']['storeId']; $storeId = $data['userInfo']['storeId'];
if ( empty($storeId) ) {
throw new CommonException(["msg" => "参数异常,获取店铺信息失败。"]);
}
return $storeId % $splitNum; return $storeId % $splitNum;
} }
} }
\ No newline at end of file
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