Commit 0f4e1b73 by xmy

Merge remote-tracking branch 'origin/master'

parents 1d74c3ea 4dc80a26
...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface; ...@@ -13,6 +13,7 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money) * @method ResultInterface deferSaveBill(string $token,int $order_id,int $buyer_id,int $store_id,string $order_sn,int $money)
* @method ResultInterface deferGetListByOrderId(int $storeId, int $orderId)
* Interface AgencyInterface * Interface AgencyInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -36,5 +37,7 @@ interface BillInterface{ ...@@ -36,5 +37,7 @@ interface BillInterface{
int $money int $money
); );
public function getListByOrderId(int $storeId, int $orderId);
} }
\ No newline at end of file
...@@ -29,7 +29,8 @@ interface BuyerInterface ...@@ -29,7 +29,8 @@ interface BuyerInterface
["storeId"]=>int(0)//店铺id ["storeId"]=>int(0)//店铺id
["referId"]=>int(0)//推荐人ID ["referId"]=>int(0)//推荐人ID
["state"]=>int(0)//买家状态 ["state"]=>int(0)//买家状态
["nickName"]=>string(0) ""买家昵称 ["nickName"]=>string(0) ""//买家昵称
["openId"]=>string(0) ""//买家openId
["profile"]=> ["profile"]=>
array(4) { array(4) {
["realName"]=>string(12) "真实姓名" ["realName"]=>string(12) "真实姓名"
......
...@@ -14,24 +14,24 @@ namespace Hdll\Services\Buyer\Lib; ...@@ -14,24 +14,24 @@ namespace Hdll\Services\Buyer\Lib;
interface CommissionInterface interface CommissionInterface
{ {
/** /**
* 扣除可提现金额 * 扣除可提现金额(仅限于对账服务使用,切记!!!)
* *
* @param $storeId * @param $storeId
* @param $buyerId * @param $buyerId
* @param $money * @param $money
* @return bool * @return bool
*/ */
public function reduceBalanceCommission($storeId, $buyerId, $money); public function reduceBalanceCommissionCompare($storeId, $buyerId, $money);
/** /**
* 增加可提现金额 * 增加可提现金额(仅限于对账服务使用,切记!!!)
* *
* @param $storeId * @param $storeId
* @param $buyerId * @param $buyerId
* @param $money * @param $money
* @return bool * @return bool
*/ */
public function addBalanceCommission($storeId, $buyerId, $money); public function addBalanceCommissionCompare($storeId, $buyerId, $money);
/** /**
* 增加累计现金额 * 增加累计现金额
......
...@@ -90,7 +90,6 @@ class CommonEntity extends Model ...@@ -90,7 +90,6 @@ class CommonEntity extends Model
} }
$request = RequestContext::getRequest(); $request = RequestContext::getRequest();
$testFlag = $request->query('flag');
//获取注解里的table //获取注解里的table
$res = new \ReflectionClass(static::class); $res = new \ReflectionClass(static::class);
......
...@@ -12,14 +12,31 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor; ...@@ -12,14 +12,31 @@ use Swoft\Redis\Operator\Processor\PrefixProcessor;
class Redis extends \Swoft\Redis\Redis class Redis extends \Swoft\Redis\Redis
{ {
private $prefix;
/** /**
* 设置redis前缀 * 设置redis前缀
* @param $prefix * @param $prefix
*/ */
public function setPrefix($prefix) public function setPrefix($prefix)
{ {
$this->prefix = $prefix;
}
public function call(string $method, array $params)
{
$config = App::getBean(PrefixProcessor::class); $config = App::getBean(PrefixProcessor::class);
$config->setPrefix($prefix); $config->setPrefix($this->prefix);
$res = parent::call($method, $params);
$config->setPrefix(config("redis.prefix",''));
return $res;
}
public function __destruct()
{
$config = App::getBean(PrefixProcessor::class);
$config->setPrefix(config("redis.prefix",''));
} }
......
...@@ -25,7 +25,7 @@ class AuthPoolConfig extends PoolProperties ...@@ -25,7 +25,7 @@ class AuthPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'auth:8099')); $this->uri = explode(',', env('RPC_AUTH_URI', 'auth:8099'));
} }
......
...@@ -20,6 +20,13 @@ use Swoft\Bean\Annotation\Value; ...@@ -20,6 +20,13 @@ use Swoft\Bean\Annotation\Value;
*/ */
class BargainPoolConfig extends PoolProperties class BargainPoolConfig extends PoolProperties
{ {
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_BARGAIN_URI', 'bargain:8099'));
}
protected $name = 'bargain'; protected $name = 'bargain';
/** /**
......
...@@ -25,7 +25,7 @@ class BuyerPoolConfig extends PoolProperties ...@@ -25,7 +25,7 @@ class BuyerPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'buyer:8099')); $this->uri = explode(',', env('RPC_AUTH_URI', 'buyer:8099'));
} }
/** /**
......
<?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\Bean\Annotation\Value;
use Swoft\Pool\PoolProperties;
/**
* the config of service user
*
* @Bean()
*/
class NoticePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_NOTICE_URI', 'notice:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'pay';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 50;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 100;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 50;
/**
* the addresses of connection
*
* <pre>
* [
* '127.0.0.1:88',
* '127.0.0.1:88'
* ]
* </pre>
*
*/
protected $uri = [
"192.168.3.100:8102",
];
/**
* whether to user provider(consul/etcd/zookeeper)
*
*/
protected $useProvider = false;
/**
* the default balancer is random balancer
*
*/
protected $balancer = '';
/**
* the default provider is consul provider
*
*/
protected $provider = '';
}
...@@ -22,7 +22,7 @@ class OrderPoolConfig extends PoolProperties ...@@ -22,7 +22,7 @@ class OrderPoolConfig extends PoolProperties
public function __construct() public function __construct()
{ {
// 区别本地和线上的RPC服务地址 // 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_RESERVATION_URI', 'order:8099')); $this->uri = explode(',', env('RPC_ORDER_URI', 'order:8099'));
} }
......
...@@ -19,6 +19,12 @@ use Swoft\Bean\Annotation\Value; ...@@ -19,6 +19,12 @@ use Swoft\Bean\Annotation\Value;
*/ */
class TimeLimitBuyPoolConfig extends PoolProperties class TimeLimitBuyPoolConfig extends PoolProperties
{ {
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_TIMELIMITBUY_URI', 'timelimitbuy:8099'));
}
protected $name = 'bargain'; protected $name = 'bargain';
/** /**
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 11:09
*/
namespace Hdll\Services\Notice\Enum;
class FormIdEnum
{
const TYPE_FORM = 0;
const TYPE_PAY = 1;
}
\ No newline at end of file
...@@ -11,15 +11,19 @@ namespace Hdll\Services\Notice\Enum; ...@@ -11,15 +11,19 @@ namespace Hdll\Services\Notice\Enum;
class NoticeEnum class NoticeEnum
{ {
//商家小程序发送 //商家小程序发送
const MINI_BACKEND_SEND= 1; const TYPE_MINI_BACKEND_SEND= 1;
//腾讯sms发送 //腾讯sms发送
const TENCENT_SMS = 2; const TYPE_TENCENT_SMS = 2;
//买家小程序消息推送
const TYPE_MINI_FRONTEND_SEND= 3;
const SEND_TYPES = [
self::MINI_BACKEND_SEND,
self::TENCENT_SMS
const SEND_TYPES = [
self::TYPE_MINI_BACKEND_SEND,
self::TYPE_TENCENT_SMS,
self::TYPE_MINI_FRONTEND_SEND
]; ];
......
...@@ -23,12 +23,11 @@ interface NoticeInterface ...@@ -23,12 +23,11 @@ interface NoticeInterface
* 参数说明 * 参数说明
* *
* 微信发送消息数据结构 * 微信发送消息数据结构
* $data[NoticeEnum::MINI_BACKEND_SEND] = [ * $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [
"touser" => $openId, "uid" => 1, //用户的id
"template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM", "template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM",//消息模板id
"page" => "index", "page" => "index", //消息模板页面
"form_id" => $formId, "data" => [ //消息模板数据
"data" => [
"keyword1" => [ "keyword1" => [
"value" => "商品名称", "value" => "商品名称",
], ],
...@@ -57,10 +56,10 @@ interface NoticeInterface ...@@ -57,10 +56,10 @@ interface NoticeInterface
]; ];
* *
* @param int $sendType * @param array $sendTypes
* @param array $data * @param array $data
* @param int $sendTime * @param int $sendTime //发送时间,立即返送填0
* @return mixed * @return mixed
*/ */
public function send(int $sendType, array $data, int $sendTime); public function send(array $sendTypes, array $data, int $sendTime) : bool ;
} }
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/23
* Time: 13:42
*/
namespace Hdll\Services\Order\Enum;
class ConsigneeEnum
{
const DEFAULT_ENABLE = 1;
const DEFAULT_DISABLE = 0;
const DEFAULT_ALLOW_VALUE = [
self::DEFAULT_DISABLE,
self::DEFAULT_ENABLE
];
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 15:28
*/
namespace Hdll\Services\Order\Enum;
class OrderCate
{
const TYPE_BUYER = 1;
const TYPE_SELLER = 2;
}
\ No newline at end of file
...@@ -21,20 +21,26 @@ class OrderEnum ...@@ -21,20 +21,26 @@ class OrderEnum
const STATUS_CANCEL = 0; //已取消 const STATUS_CANCEL = 0; //已取消
const STATUS_CLOSED = 70; //已关闭 const STATUS_CLOSED = 70; //已关闭
const STATUS_REFUNDING = 80; //退款中 const STATUS_REFUNDING = 80; //退款中
const STATUS_EVALUATION = 90; //已评价
//订单类型 //订单类型
const TYPE_GOODS = 0; //商品订单 const TYPE_GOODS = 0; //商品订单
const TYPE_CUT_PRICE = 1; //砍价订单 const TYPE_CUT_PRICE = 1; //砍价订单
const TYPE_LIMIT = 2; //限时购订单 const TYPE_LIMIT = 2; //限时购订单
const TYPE_COLLECTION = 3; //拼团 const TYPE_COLLECTION = 3; //拼团
const TYPE_VALUE_ADDED_SERVICE = 4; //增值服务
const ORDER_TYPES = [ const ORDER_TYPES = [
self::TYPE_GOODS, self::TYPE_GOODS,
self::TYPE_CUT_PRICE, self::TYPE_CUT_PRICE,
self::TYPE_LIMIT, self::TYPE_LIMIT,
self::TYPE_COLLECTION, self::TYPE_COLLECTION,
self::TYPE_VALUE_ADDED_SERVICE, ];
const PAID_STATUS = [
self::STATUS_PAID,
self::STATUS_DELIVERY,
self::STATUS_DELIVERED,
self::STATUS_EVALUATION
]; ];
//对账状态 //对账状态
......
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:56
*/
namespace Hdll\Services\Order\Enum;
class SellerOrderEnum
{
const TYPE_VALUE_ADDED_SERVICE = 1; //增值服务
//订单状态
const STATUS_UNPAID = 10; //待支付
const STATUS_PAID = 20; //已支付
}
\ No newline at end of file
...@@ -15,9 +15,10 @@ use Swoft\Core\ResultInterface; ...@@ -15,9 +15,10 @@ use Swoft\Core\ResultInterface;
/** /**
* The interface of demo service * The interface of demo service
* *
* @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $activity_id,int $selected_num,int $order_type,float $total,float $goods_price,string $goods_name,string $goods_image,string $activity_name,string $reservation_time = '') * @method ResultInterface deferCreateOrder( string $token,int $consignee_id,int $activity_id,int $selected_num,int $order_type,float $total,float $goods_price,string $goods_name,string $goods_image,string $activity_name,int $goodsId,string $reservation_time = '')
* @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn) * @method ResultInterface deferGetOrderInfoBySn(int $storeId, string $orderSn)
* @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId) * @method ResultInterface deferGetOrderInfo(int $storeId,int $orderId)
* @method ResultInterface deferUpdateInfoById(int $storeId,int $orderId, array $updateInfo)
*/ */
interface OrderInterface interface OrderInterface
{ {
...@@ -34,6 +35,7 @@ interface OrderInterface ...@@ -34,6 +35,7 @@ interface OrderInterface
* @param string $goods_name * @param string $goods_name
* @param string $goods_image * @param string $goods_image
* @param string $activity_name * @param string $activity_name
* @param int $goodsId,
* @param string $reservation_time * @param string $reservation_time
* @return mixed * @return mixed
*/ */
...@@ -49,23 +51,12 @@ interface OrderInterface ...@@ -49,23 +51,12 @@ interface OrderInterface
string $goods_name, string $goods_name,
string $goods_image, string $goods_image,
string $activity_name, string $activity_name,
int $goodsId,
string $reservation_time = ''); string $reservation_time = '');
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId,
int $selectedNum,
int $orderType,
float $total,
float $goodsPrice,
string $goodsName
);
public function getOrderInfo(int $storeId,int $orderId); public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn); public function getOrderInfoBySn(int $storeId, string $orderSn);
public function updateInfoById(int $orderId, array $updateInfo); public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
} }
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/8/24
* Time: 13:57
*/
namespace Hdll\Services\Order\Lib;
interface SellerOrderInterface
{
public function sellerCreateOrder(
int $sellerId,
int $storeId,
int $itemId,
int $selectedNum,
int $orderType,
float $total,
float $goodsPrice,
string $goodsName
);
public function getOrderInfo(int $storeId,int $orderId);
public function getOrderInfoBySn(int $storeId, string $orderSn);
public function updateInfoById(int $storeId,int $orderId, array $updateInfo);
}
\ No newline at end of file
...@@ -11,10 +11,14 @@ use Swoft\Core\ResultInterface; ...@@ -11,10 +11,14 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId) * @method ResultInterface deferCreateOrder(int $storeId, int $orderId, int $openId)
* @method ResultInterface deferGenerateSellerSign(int $storeId, int $orderId, string $openId)
*
* Interface PayInterface * Interface PayInterface
* @package Hdll\Services\Pay\Lib * @package Hdll\Services\Pay\Lib
*/ */
interface PayInterface interface PayInterface
{ {
public function generateSign(int $storeId, int $orderId, string $openId); public function generateSign(int $storeId, int $orderId, string $openId);
public function generateSellerSign(int $storeId, int $orderId, string $openId);
} }
...@@ -12,11 +12,13 @@ use Swoft\Core\ResultInterface; ...@@ -12,11 +12,13 @@ use Swoft\Core\ResultInterface;
/** /**
* *
* @method ResultInterface deferGetFund($sellerId) * @method ResultInterface deferGetFund($seller)
* @method ResultInterface deferAddBalance($sellerId) * @method ResultInterface deferAddBalance($seller, $money)
* @method ResultInterface deferReduceBalance($sellerId) * @method ResultInterface deferReduceBalance($seller, $money)
* @method ResultInterface deferAddTotal($sellerId) * @method ResultInterface deferAddTotal($seller, $money)
* @method ResultInterface deferReduceTotal($sellerId) * @method ResultInterface deferReduceTotal($seller, $money)
* @method ResultInterface deferAddExpectFund($seller, $money)
* @method ResultInterface deferAddFund($seller, $money)
* Interface SellerInterface * Interface SellerInterface
* @package App\Lib * @package App\Lib
*/ */
...@@ -73,4 +75,22 @@ interface SellerFundInterface ...@@ -73,4 +75,22 @@ interface SellerFundInterface
*/ */
public function getFund($sellerId); public function getFund($sellerId);
/**
* 增加冻结金额
* @param $sellerId
* @param $money
* @return mixed
* @author Administrator
*/
public function addExpectFund($sellerId,$money);
/**
* 增加金额
* @param $sellerId
* @param $balanceFund 可提现金额
* @param $commissionFund 佣金
* @return mixed
* @author Administrator
*/
public function addFund($sellerId, $balanceFund, $commissionFund);
} }
\ 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