Commit 98dd4ea7 by 王召彬
parents 84b50e6f 10e2e3cb
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Date: 2018/7/5 * Date: 2018/7/5
* Time: 15:47 * Time: 15:47
*/ */
namespace Hdll\Services\Buyer; namespace Hdll\Services\Buyer\Lib;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
...@@ -21,4 +21,5 @@ interface BuyerInterface ...@@ -21,4 +21,5 @@ interface BuyerInterface
public function updateProfile(string $token, array $data); public function updateProfile(string $token, array $data);
public function hasUser($storeId,$unionid);
} }
\ No newline at end of file
...@@ -59,14 +59,12 @@ class CommonEntity extends Model ...@@ -59,14 +59,12 @@ class CommonEntity extends Model
*/ */
protected function split() protected function split()
{ {
$request = RequestContext::getRequest(); if ( empty(RequestContext::getContextData()) ) {//初始化不做处理
if ( empty($request) ) {//初始化不做处理
return; return;
} }
$testFlag = $request->query('flag');
if ( false === strpos(self::$commentString,"{split}") || $testFlag == 'hdllTest' ) { if ( false === strpos(self::$commentString,"{split}") || App::$isInTest ) {
return; return;
} }
...@@ -86,18 +84,19 @@ class CommonEntity extends Model ...@@ -86,18 +84,19 @@ class CommonEntity extends Model
*/ */
public static function tableName() public static function tableName()
{ {
$request = RequestContext::getRequest();
if ( empty($request) ) {//初始化不做处理 if ( empty(RequestContext::getContextData()) ) {//初始化不做处理
return; return;
} }
$request = RequestContext::getRequest();
$testFlag = $request->query('flag'); $testFlag = $request->query('flag');
//获取注解里的table //获取注解里的table
$res = new \ReflectionClass(static::class); $res = new \ReflectionClass(static::class);
self::$commentString = $res->getDocComment(); self::$commentString = $res->getDocComment();
if ( false !== strpos(self::$commentString,"{split}") && $testFlag != 'hdllTest') { if ( false !== strpos(self::$commentString,"{split}") && App::$isInTest) {
$dbNum = self::getDbNum(); $dbNum = self::getDbNum();
$tableName = self::getTableName().'_'.$dbNum; $tableName = self::getTableName().'_'.$dbNum;
self::setTableName($tableName); self::setTableName($tableName);
......
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class StorePoolConfig extends PoolProperties
{
protected $name = 'seller';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected $uri = [
'192.168.3.23:8098',
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
<?php
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://doc.swoft.org
* @contact group@swoft.org
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class VipPoolConfig extends PoolProperties
{
protected $name = 'seller';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
* @var int
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
* @var int
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
* @var int
*/
protected $timeout = 200;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
* @var array
*/
protected $uri = [
'192.168.3.39:8200',
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
* @var bool
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
* @var string
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
* @var string
*/
protected $provider = '';
}
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/17
* Time: 14:19
*/
namespace Hdll\Services\SellerDistribution\Enum;
class SellerDistributionEnum
{
const SETTING = [1 => 0.2, 2 => 0.1];
}
\ No newline at end of file
...@@ -11,14 +11,12 @@ namespace Hdll\Services\SellerDistribution\Enum; ...@@ -11,14 +11,12 @@ namespace Hdll\Services\SellerDistribution\Enum;
class SellerDistributionError class SellerDistributionError
{ {
const E001 = [001, '参数非法',400]; const E101 = [101, '店铺不存在'];
const E002 = [002, '无效的Token',403]; const E102 = [102, '该数据不属于您', 403];
const E003 = [003, '无权限操作',403]; const E103 = [103, '请勿重复创建', 403];
const E004 = [004, '数据不存在',404]; const E104 = [104, '该用户不存在或属于您的团队', 403];
const E105 = [105, '未开启分销', 200];
const E101 = [101, '微信支付错误', 500]; const E106 = [106, '分销上级不存在', 404];
const E102 = [102, '订单不存在或状态异常', 404];
const E103 = [103, '升级VIP失败,没有找到对应的店铺', 404];
public function getError($code) public function getError($code)
{ {
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/27
* Time: 16:28
*/
namespace Hdll\Services\Vip\Lib;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferOpenVip($token,$orderId,$money)
* @method ResultInterface deferUpdate($token,$condition, $data)
* Interface SellerInterface
* @package App\Lib
*/
interface VipInterface
{
public function openVip($token,$orderId,$money);
public function update($token,$condition, $data);
}
\ 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