Commit 77b2ea3b by 王召彬

Merge branch 'master' of http://139.199.22.180/tencent/services

parents 3b90f3cd 1f73d396
......@@ -8,15 +8,16 @@
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace Hdll\Services\LimitTimeBuy\Lib;
namespace Hdll\Services\AccountBook\Lib;
use Hdll\Services\LimitTimeBuy\Enum\LimitTimeOrderEnum;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferBackNum(string $token, int $consignee_id, int $limit_id, int $selected_num, int $order_type, int $goods_id, string $reservation_time = '')
* @method ResultInterface deferIncome(int $storeId, int $money,int $orderId)
* @method ResultInterface deferExpense(int $storeId, int $money,int $orderId)
*/
interface AccountInterface
{
......@@ -28,6 +29,7 @@ interface AccountInterface
* @return bool
*/
public function Income($storeId, $money, $ordirId);
/**
* 流水减少
* @param $storeId
......
......@@ -63,7 +63,13 @@ class Split
$splitCollector = SplitCollector::getCollector();
$splitNum = $splitCollector[$className]['num'];
$data = RequestContext::getContextData();
$dbNum = $data['dbNum'];
if ( ! empty($dbNum) ) {//若手动设置的分表信息则直接返回设置的表号
return $dbNum;
}
$storeId = $data['userInfo']['storeId'];
if ( empty($storeId) ) {
throw new CommonException(["msg" => "参数异常,获取店铺信息失败。"]);
}
......
<?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;
use Swoft\Bean\Annotation\Value;
/**
* @Bean()
* the config of service bargain
*/
class AccountBookPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_ACCOUNTBOOK_URI', 'accountbook:8099'));
}
protected $name = 'accountbook';
/**
* 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>
* @Value(name="", env="${RPC_BARGAIN_URI}")
* @var array
*/
protected $uri = [
'timelimtbuy:8099',
];
/**
* 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 = '';
}
......@@ -15,6 +15,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferIncSales($storeId, $goodsId)
* @method ResultInterface deferDecSales($storeId, $goodsId)
* @method ResultInterface deferGetServiceByGoodsId($storeId, $goodsId)
* @method ResultInterface deferGetReturnVisitByGoodsId($storeId, $goodsId)
* Interface GoodsInterface
* @package Hdll\Services\Goods\Lib
*/
......@@ -72,4 +73,14 @@ interface GoodsInterface
* @author Administrator
*/
public function getServiceByGoodsId($storeId,$goodsId);
/**
* 获取用户回访
* @param $storeId
* @param $goodsId
* @return mixed
* @author Administrator
*/
public function getReturnVisitByGoodsId($storeId, $goodsId);
}
\ No newline at end of file
......@@ -64,7 +64,7 @@ class MiniBackendSender implements SenderInterface
*/
public function getData ()
{
return $this->data;
return $this->data === null?[]:$this->data;
}
/**
......
......@@ -90,7 +90,7 @@ class MiniFrontendSender implements SenderInterface
*/
public function getData ()
{
return $this->data;
return $this->data === null?[]:$this->data;
}
/**
......
......@@ -50,7 +50,7 @@ class MpSender implements SenderInterface
public function getData()
{
return $this->data;
return $this->data === null?[]:$this->data;
}
public function getSendType()
......
......@@ -42,7 +42,7 @@ class TencentSMS implements SenderInterface
public function getData()
{
$this->data;
return $this->data === null?[]:$this->data;
}
public function getSendType()
......
......@@ -42,9 +42,7 @@ class NoticeExtension
$sender->format();
$data += $sender->getData();
$sendType += $sender->getSendType();
$sendType = array_merge($sender->getSendType(), $sendType);
}
......
......@@ -16,6 +16,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetByUnionId($unionId,$fields=['*'])
* @method ResultInterface deferGetByStoreId($storeId,$fields=['*'])
* @method ResultInterface deferUpdate($id,$data)
* @method ResultInterface deferCountDistributionNum($sellerId)
* Interface SellerInterface
* @package App\Lib
*/
......@@ -74,4 +75,6 @@ interface SellerInterface
*/
public function getByStoreId($storeId, $fields = ['*']);
public function countDistributionNum($sellerId);
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ use Swoft\Core\ResultInterface;
* The interface of store-settings service
*
* @method ResultInterface deferGetSettings(int $storeId)
* @method ResultInterface deferGetNoticeSwitch(int $storeId)
*/
interface SettingsInterface
{
......@@ -28,4 +29,25 @@ interface SettingsInterface
*/
public function getSettings(int $storeId);
/**
* 获取消息通知的开关设置项
*
* @Number(name="storeId")
* @param int $storeId
* @return array
* array(5) {
* ["pay_notice"]=> // 付款通知,1表示允许发送通知
* int(0)
* ["refund_notice"]=> // 退款通知,1表示允许发送通知
* int(1)
* ["reserv_notice"]=> // 预约通知,1表示允许发送通知
* int(0)
* ["cancel_reserv_notice"]=> // 取消预约通知,1表示允许发送通知
* int(0)
* ["delivered_notice"]=> // 核销通知,1表示允许发送通知
* int(1)
* }
*/
public function getNoticeSwitch(int $storeId);
}
\ 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