Commit ae2d7d0a by 王召彬
parents 9f25c364 b0a1b295
.idea
/vendor/
swoft/
\ No newline at end of file
...@@ -14,6 +14,9 @@ class BuyerError ...@@ -14,6 +14,9 @@ class BuyerError
const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 24102]; const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 24102];
const SCORE_ERR = ["msg" => "你无权创建该用户", "code" => 403, "errorCode" => 24103]; const SCORE_ERR = ["msg" => "你无权创建该用户", "code" => 403, "errorCode" => 24103];
const NOT_FOUND_COMMISSION = ["msg" => "获取佣金信息失败", "code" => 404, "errorCode" => 24104];
const INSUFFICIENT_COMMISSION = ["msg" => "可提现金额不足,无法提现", "code" => 400, "errorCode" => 24105];
public static function atranslate($message,$param) public static function atranslate($message,$param)
{ {
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/2
* Time: 9:49
*/
namespace Hdll\Services\Buyer\Lib;
/**
* Interface CommissionInterface
* @package Hdll\Services\Buyer\Lib
*/
interface CommissionInterface
{
/**
* 扣除可提现金额
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public function reduceBalanceCommission($storeId, $buyerId, $money);
/**
* 增加可提现金额
*
* @param $storeId
* @param $buyerId
* @param $money
* @return bool
*/
public function addBalanceCommission($storeId, $buyerId, $money);
}
\ No newline at end of file
...@@ -11,30 +11,21 @@ class ExceptionParseData ...@@ -11,30 +11,21 @@ class ExceptionParseData
{ {
public static function parseData(\Exception $e) public static function parseData(\Exception $e)
{ {
$exception = $e->getMessage(); if ( is_callable($e,'getResponse') ) {
$pos = strpos($exception,"the return status of rpc is incorrected,data"); $response = $e->getResponse();
if ( false !== $pos ) {
$exception = str_replace("the return status of rpc is incorrected,data=","",$exception);
$throw_data = json_decode($exception,true); preg_match("/{.*}/",$response['msg'],$data);
$parse_data = explode(' ',$throw_data['msg']); $msg = isset($data['0'])?$data['0']:'';
$data = ['msg' => $parse_data[0], 'file' => $parse_data[1], 'line' => $parse_data[2], 'code' => $throw_data['status']];
$data = json_decode($msg,true);
} else { } else {
$file = $e->getFile(); $data['msg'] = $e->getMessage();
$line = $e->getLine(); $data['code'] = $e->getCode();
$code = $e->getCode(); $data['file'] = $e->getFile().' '.$e->getLine();
$exception = $e->getMessage();
$data = ['msg' => $exception, 'file' => $file, 'line' => $line, 'code' => $code];
} }
return $data; return $data;
} }
} }
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
namespace Hdll\Services\Common\Pool\Config; namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean; use Swoft\Bean\Annotation\Bean;
use Swoft\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties; use Swoft\Pool\PoolProperties;
/** /**
...@@ -20,48 +21,45 @@ use Swoft\Pool\PoolProperties; ...@@ -20,48 +21,45 @@ use Swoft\Pool\PoolProperties;
*/ */
class BuyerPoolConfig extends PoolProperties class BuyerPoolConfig extends PoolProperties
{ {
/**
* the name of pool
*
*/
protected $name = 'buyer'; protected $name = 'buyer';
/** /**
* Minimum active number of connections * Minimum active number of connections
* *
* @var int
*/ */
protected $minActive = 5; protected $minActive = 5;
/** /**
* the maximum number of active connections * the maximum number of active connections
* *
* @var int
*/ */
protected $maxActive = 50; protected $maxActive = 50;
/** /**
* the maximum number of wait connections * the maximum number of wait connections
* *
* @var int
*/ */
protected $maxWait = 100; protected $maxWait = 100;
/** /**
* Maximum waiting time * Maximum waiting time
* *
* @var int
*/ */
protected $maxWaitTime = 3; protected $maxWaitTime = 3;
/** /**
* Maximum idle time * Maximum idle time
* *
* @var int
*/ */
protected $maxIdleTime = 60; protected $maxIdleTime = 60;
/** /**
* the time of connect timeout * the time of connect timeout
* *
* @var int
*/ */
protected $timeout = 200; protected $timeout = 200;
...@@ -75,30 +73,27 @@ class BuyerPoolConfig extends PoolProperties ...@@ -75,30 +73,27 @@ class BuyerPoolConfig extends PoolProperties
* ] * ]
* </pre> * </pre>
* *
* @var array
*/ */
protected $uri = [ protected $uri = [
'192.168.3.100:8101', "192.168.3.100:8106"
]; ];
/** /**
* whether to user provider(consul/etcd/zookeeper) * whether to user provider(consul/etcd/zookeeper)
* *
* @var bool
*/ */
protected $useProvider = false; protected $useProvider = false;
/** /**
* the default balancer is random balancer * the default balancer is random balancer
* *
* @var string
*/ */
protected $balancer = ''; protected $balancer = '';
/** /**
* the default provider is consul provider * the default provider is consul provider
* *
* @var string
*/ */
protected $provider = ''; protected $provider = '';
} }
...@@ -21,7 +21,7 @@ use Swoft\Pool\PoolProperties; ...@@ -21,7 +21,7 @@ use Swoft\Pool\PoolProperties;
class StorePoolConfig extends PoolProperties class StorePoolConfig extends PoolProperties
{ {
protected $name = 'seller'; protected $name = 'storeId';
/** /**
* Minimum active number of connections * Minimum active number of connections
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/7/27
* Time: 16:28
*/
namespace Hdll\Services\Seller\Lib;
use Swoft\Core\ResultInterface;
/**
*
* @method ResultInterface deferWithdraw($sellerId, $money)
* @method ResultInterface deferWithdrawFail($sellerId, $money)
* Interface SellerInterface
* @package App\Lib
*/
interface SellerFundInterface
{
/**
* 提现
* @param $sellerId
* @param $money (分)
* @return mixed
* @author Administrator
*/
public function withdraw($sellerId, $money);
/**
* 提现失败
* @param $sellerId
* @param $money (分)
* @return mixed
* @author Administrator
*/
public function withdrawFail($sellerId, $money);
}
\ No newline at end of file
...@@ -9,8 +9,7 @@ namespace Hdll\Services\SellerDistribution\Lib; ...@@ -9,8 +9,7 @@ namespace Hdll\Services\SellerDistribution\Lib;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money, $level, $memo = '') * @method ResultInterface deferSaveBill($orderId, $sellerId, $money)
* @method ResultInterface deferSaveCommission($sellerId, $orderId, $money)
* Interface SellerDistributionInterface * Interface SellerDistributionInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -27,15 +26,6 @@ interface SellerDistributionInterface{ ...@@ -27,15 +26,6 @@ interface SellerDistributionInterface{
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function saveBill($orderId, $sellerId, $money, $level, $memo = ''); public function saveBill($orderId, $sellerId, $money);
/**
* 保存佣金记录
* @param $sellerId
* @param $orderId
* @param $money
* @return mixed
* @author Administrator
*/
public function saveCommission($sellerId, $orderId, $money);
} }
\ No newline at end of file
...@@ -11,17 +11,17 @@ namespace Hdll\Services\Vip\Lib; ...@@ -11,17 +11,17 @@ namespace Hdll\Services\Vip\Lib;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferOpenVip($token,$orderId,$money) * @method ResultInterface deferOpenVip($storeId,$orderId,$money)
* @method ResultInterface deferUpdate($token,$condition, $data) * @method ResultInterface deferUpdate($storeId,$condition, $data)
* Interface SellerInterface * Interface SellerInterface
* @package App\Lib * @package App\Lib
*/ */
interface VipInterface interface VipInterface
{ {
public function openVip($token,$orderId,$money); public function openVip($storeId,$orderId,$money);
public function update($token,$condition, $data); public function update($storeId,$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