Commit 212befb6 by xmy

Merge remote-tracking branch 'origin/master'

parents 6da79823 6f0e8dff
# 2.0.44
- VIP保赚服务上线
# 2.0.43
- 优惠券上线
# 2.0.42
- 活动方案+实物订单上线
......
......@@ -12,6 +12,7 @@ use Swoft\Core\ResultInterface;
/**
* @method ResultInterface deferGetInfo(int $id)
* @method ResultInterface deferGetBatch(array $ids)
* Interface VisitorInterface
* @package App\Lib
*/
......@@ -24,4 +25,16 @@ interface ActivityPlanInterface
*/
public function getInfo(int $id);
/**
* 根据ids批量获取活动方案信息
* @param array $ids
* @return mixed
* 返回示例:
* [
* "id" => ["id" => 1, "title" => "方案名称"], // 键值对返回,下标是方案id
* ... ...
* ]
*/
public function getBatch(array $ids);
}
\ No newline at end of file
<?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;
/**
*
* @Bean()
*/
class InsurancePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_INSURANCE_URI', 'insurance:8099'));
}
/**
* the name of pool
*
*/
protected $name = 'insurance';
/**
* Minimum active number of connections
*
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
*/
protected $maxWait = 400;
/**
* Maximum waiting time
*
*/
protected $maxWaitTime = 3;
/**
* Maximum idle time
*
*/
protected $maxIdleTime = 60;
/**
* the time of connect timeout
*
*/
protected $timeout = 200;
/**
* 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 = '';
}
......@@ -14,6 +14,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferAdd(int $storeId, array $data)
* @method ResultInterface deferBrowseAndShare(int $storeId, int $type, array $itemIds)
* @method ResultInterface deferNewVisitor(int $storeId, int $type, array $itemIds = null)
* @method ResultInterface deferVisitorCount(array $storeIds, int $beginDate, int $endDate)
* Interface VisitorInterface
* @package App\Lib
*/
......@@ -74,4 +75,14 @@ interface VisitorInterface
*/
public function newVisitor(int $storeId, int $type, array $itemIds = null);
/**
* 根据日期访问统计访客数
* @param array $storeIds 店铺id列表
* @param int $beginDate 开始日期,格式:20191212
* @param int $endDate 开始日期,格式:20191212
* @return mixed
* 响应参数:数字
*/
public function visitorCount(array $storeIds, int $beginDate, int $endDate);
}
\ No newline at end of file
<?php
namespace Hdll\Services\Insurance\Enum;
class InsuranceCmqEnum
{
const TOPIC = 'insurance';
const ACTIVITY_CREATE = 'activityCreate'; // 使用活动方案创建活动时通知
}
\ No newline at end of file
<?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\Insurance\Lib;
use Swoft\Core\ResultInterface;
/**
* The interface of insurance service
*
* @method ResultInterface deferGetOrderInfo(int $storeId, int $orderId)
* @method ResultInterface deferGetOrderBySn(int $storeId, $orderSn)
* @method ResultInterface deferPaySuccess(int $storeId, $orderSn)
*/
interface InsuranceInterface
{
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param integer $orderId
* @return array
*/
public function getOrderInfo(int $storeId, int $orderId);
/**
* 获取指定订单数据
*
* @param integer $storeId
* @param string $orderSn
* @return array
*/
public function getOrderBySn(int $storeId, $orderSn);
/**
* 支付成功回调
*
* @param integer $storeId
* @param string $orderSn
* @return void
*/
public function paySuccess(int $storeId, $orderSn);
}
\ No newline at end of file
<?php
namespace Hdll\Services\MemberCard\Enum;
class CardType {
const member_card = 0;
const cash = 100;
const gift = 200;
const CARD_TYPE = [
self::member_card =>'member_card',
self::cash => 'cash',
self::gift => 'gift'
];
}
\ No newline at end of file
<?php
namespace Hdll\Services\MemberCard\Enum;
class CouponOrderStatus
{
//订单状态
const STATUS_NORMAL = 1; //待支付
const STATUS_HAVE_PAY =2; // 已经支付 //=已下单
const STATUS_PAY_EXCEPTION =3; // 支付异常或过期未付 //=关闭订单
const STATUS_PAY_REFUND =4 ; // 退款 //=已过期
}
\ No newline at end of file
......@@ -21,6 +21,10 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetOrder(int $storeId,int $id)
* @method ResultInterface deferGetOrderBySn(int $storeId,string $sn)
* @method ResultInterface deferIfUserGetCard(int $storeId,int $userId,int $escrow)
* @method ResultInterface deferGetUserCouponDetail(int $storeId ,int $couponId)
* @method ResultInterface deferSetUserCouponStatus(int $storeId,int $couponId,int $status)
* @method ResultInterface deferGetUserValidCouponNum(int $storeId,int $escrow,int $userId)
* @method ResultInterface deferIfCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods)
*/
/**
* The interface of demo service
......@@ -41,7 +45,7 @@ interface MemberCardInterface
/**
* 支付订单
* 支付订单(H5快速买单)
* @param integer $storeId
* @param string $orderSn
* @param integer $payStatus
......@@ -74,5 +78,46 @@ interface MemberCardInterface
* @param integer $escrow
* @return bool
*/
public function ifUserGetCard(int $storeId,int $userId,int $escrow);
public function ifUserGetCard(int $storeId,int $userId,int $escrow);
/**
* 查询优惠券详细信息
*
* @param integer $storeId
* @param integer $couponId
* @return void
*/
public function getUserCouponDetail(int $storeId ,int $couponId);
/**
* 根据订单状态更改 优惠券的使用的相关状态
*
* @param integer $storeId
* @param integer $couponId
* @param integer $status
* @return bool
*/
public function setUserCouponStatus(int $storeId,int $couponId,int $status);
/**
* 获取用户未失效优惠券数量
*
* @param integer $storeId
* @param integer $escrow
* @param integer $userId
* @return int
*/
public function getUserValidCouponNum(int $storeId,int $escrow,int $userId);
/**
* 判断优惠券是否适用于订单(下单的时候调用)
*
* @param integer $storeId
* @param integer $userId
* @param integer $couponId
* @param array $goods [{goodsId:totalPrice},...]
* @return bool
*/
public function ifCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods);
}
......@@ -32,6 +32,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetShopNewOrderNum(int $storeId)
* @method ResultInterface deferOrderCountByCondition(int $storeId,array $condition)
* @method ResultInterface deferBuyerSpendAmount(int $storeId,int $buyerId)
* @method ResultInterface deferBanchGetShopStByDate(array $storeIds,int $date)
*/
interface OrderInterface
{
......@@ -227,4 +228,21 @@ interface OrderInterface
* @return int
*/
public function buyerSpendAmount(int $storeId,int $buyerId);
/**
* 批量查询指定日期及店铺的交易统计数据
*
* @param array $storeIds
* @param integer $date
* @return array
* [
* [
* 'storeId' => 11,//店铺ID
* 'buyerNum' => 0,//买家数
* 'orderNum' => 0,//订单数
* 'orderAmount' => 0//营业金额
* ]
* ]
*/
public function banchGetShopStByDate(array $storeIds,int $date);
}
\ 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