Commit ae2d7d0a by 王召彬
parents 9f25c364 b0a1b295
.idea
/vendor/
swoft/
\ No newline at end of file
......@@ -14,6 +14,9 @@ class BuyerError
const DB_ERROR = ["msg" => "数据库操作错误", "code" => 500, "errorCode" => 24102];
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)
{
......
<?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
{
public static function parseData(\Exception $e)
{
$exception = $e->getMessage();
$pos = strpos($exception,"the return status of rpc is incorrected,data");
if ( false !== $pos ) {
$exception = str_replace("the return status of rpc is incorrected,data=","",$exception);
if ( is_callable($e,'getResponse') ) {
$response = $e->getResponse();
$throw_data = json_decode($exception,true);
$parse_data = explode(' ',$throw_data['msg']);
$data = ['msg' => $parse_data[0], 'file' => $parse_data[1], 'line' => $parse_data[2], 'code' => $throw_data['status']];
preg_match("/{.*}/",$response['msg'],$data);
$msg = isset($data['0'])?$data['0']:'';
$data = json_decode($msg,true);
} else {
$file = $e->getFile();
$line = $e->getLine();
$code = $e->getCode();
$exception = $e->getMessage();
$data = ['msg' => $exception, 'file' => $file, 'line' => $line, 'code' => $code];
$data['msg'] = $e->getMessage();
$data['code'] = $e->getCode();
$data['file'] = $e->getFile().' '.$e->getLine();
}
return $data;
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
namespace Hdll\Services\Common\Pool\Config;
use Swoft\Bean\Annotation\Bean;
use Swoft\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
......@@ -20,48 +21,45 @@ use Swoft\Pool\PoolProperties;
*/
class BuyerPoolConfig extends PoolProperties
{
/**
* the name of pool
*
*/
protected $name = 'buyer';
/**
* 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;
......@@ -75,30 +73,27 @@ class BuyerPoolConfig extends PoolProperties
* ]
* </pre>
*
* @var array
*/
protected $uri = [
'192.168.3.100:8101',
"192.168.3.100:8106"
];
/**
* 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 = '';
}
......@@ -21,7 +21,7 @@ use Swoft\Pool\PoolProperties;
class StorePoolConfig extends PoolProperties
{
protected $name = 'seller';
protected $name = 'storeId';
/**
* 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;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money, $level, $memo = '')
* @method ResultInterface deferSaveCommission($sellerId, $orderId, $money)
* @method ResultInterface deferSaveBill($orderId, $sellerId, $money)
* Interface SellerDistributionInterface
* @package App\Lib
*/
......@@ -27,15 +26,6 @@ interface SellerDistributionInterface{
* @return mixed
* @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;
use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferOpenVip($token,$orderId,$money)
* @method ResultInterface deferUpdate($token,$condition, $data)
* @method ResultInterface deferOpenVip($storeId,$orderId,$money)
* @method ResultInterface deferUpdate($storeId,$condition, $data)
* Interface SellerInterface
* @package App\Lib
*/
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