Commit 92574a5f by zhangsong

Merge branch 'test' of http://git.dev.2b3.cn/tencent/services into test

parents ea5abf37 b702e0e7
# 2.0.17
- 配合前端v2版本上线
# 2.0.16
- 修复bug
# 2.0.15
- 分成比例修改
# 2.0.14 # 2.0.14
- Cls记日志忽略‘验证器不存在’的日志 - Cls记日志忽略‘验证器不存在’的日志
...@@ -9,6 +18,7 @@ ...@@ -9,6 +18,7 @@
# 2.0.11 # 2.0.11
- 砍价订单枚举状态加订单删除 - 砍价订单枚举状态加订单删除
- 关闭拼团活动状态
# 2.0.10 # 2.0.10
- 根据商户平台id获取对应的小程序托管配置 - 根据商户平台id获取对应的小程序托管配置
......
<?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\Album\Lib;
use Swoft\Core\ResultInterface;
/**
* album servcie
* @method ResultInterface deferGetAlbumNumByCmid(int $storeId,int $cmId)
*/
interface AlbumInterface
{
/**
* 查询店员相册个数
*
* @param integer $storeId
* @param integer $cmId
* @return int
*/
public function getAlbumNumByCmid(int $storeId,int $cmId);
}
\ 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\Pool\PoolProperties;
/**
* the config of service album
*
* @Bean()
*/
class AlbumPoolConfig extends PoolProperties
{
public function __construct()
{
$this->uri=explode(',',env('RPC_ALBUM_URI','album:8099'));
}
protected $name = 'album';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 400;
/**
* 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>
*
* @var array
*/
protected $uri = [];
/**
* 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 = '';
}
<?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 frontmoney
*/
class FrontMoneyPoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
$this->uri = explode(',', env('RPC_FRONTMONEY_URI', 'frontmoney:8099'));
}
protected $name = 'frontmoney';
/**
* Minimum active number of connections
*
* @var int
*/
protected $minActive = 5;
/**
* the maximum number of active connections
*
* @var int
*/
protected $maxActive = 300;
/**
* the maximum number of wait connections
*
* @var int
*/
protected $maxWait = 400;
/**
* 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_FRONTMONEY_URI}")
* @var array
*/
protected $uri = [
'frontmoney: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 = '';
}
<?php
namespace Hdll\Services\Craftsman\Enum;
class CmanEnum
{
const SYNC_ITEM_ADD = 1;//新加商品
const SYNC_ITEM_DEL = 2;//去除商品
}
\ No newline at end of file
...@@ -18,6 +18,7 @@ use Swoft\Core\ResultInterface; ...@@ -18,6 +18,7 @@ use Swoft\Core\ResultInterface;
* *
* @method ResultInterface deferGetCraftsmenList(int $storeId, int $subStoreId = 0, int $itemId = 0) * @method ResultInterface deferGetCraftsmenList(int $storeId, int $subStoreId = 0, int $itemId = 0)
* @method ResultInterface deferGetCraftsmenByUnionId(string $unionId) * @method ResultInterface deferGetCraftsmenByUnionId(string $unionId)
* @method ResultInterface defercreateCraftsman($storeId, array $params)
* @method ResultInterface deferGetCraftsmenById(int $storeId, int $cmanId) * @method ResultInterface deferGetCraftsmenById(int $storeId, int $cmanId)
* @method ResultInterface deferGetCraftsmenByIds(int $storeId, array $cmanIds) * @method ResultInterface deferGetCraftsmenByIds(int $storeId, array $cmanIds)
* @method ResultInterface deferSyncItems(int $storeId, array $itemIds, int $mode) * @method ResultInterface deferSyncItems(int $storeId, array $itemIds, int $mode)
...@@ -37,6 +38,26 @@ interface CraftsmanInterface ...@@ -37,6 +38,26 @@ interface CraftsmanInterface
// wechat 店员微信号 // wechat 店员微信号
/** /**
* 创建店员
*
* @param integer $storeId
* @param array $params 所需参数
*array(
* 'name' => '', // 姓名
* 'sex' => '', // 性别
* 'wxNick' => '', // 昵称
* 'headimg' => '', // 头像
* 'items' => '', // 包含的服务项目列表
* 'subStores' => '', // 所属门店列表
* 'motto' => '', // 个性签名
* 'adept' => '', // 个人擅长
* 'wechat' => '', // 微信号
*)
* @return int|bool
*/
public function createCraftsman($storeId, array $params);
/**
* 获取店员列表 * 获取店员列表
* *
* @param integer $storeId * @param integer $storeId
......
<?php
namespace Hdll\Services\FrontMoney\Enum;
class FrontCmqEnum
{
const TOPIC = 'frontMoney';
const UP_ORDER_STATUS = 'upOrderStatus'; //更新订单状态
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: lwt
* Date: 2018/7/10
* Time: 13:15
*/
namespace Hdll\Services\FrontMoney\Enum;
class FrontMoneyEnum
{
//订单状态
const STATUS_NORMAL = 10; //待支付
}
\ No newline at end of file
<?php
namespace Hdll\Services\FrontMoney\Enum;
class FrontOrderEnum
{
//订单状态
const STATUS_NORMAL = 1; //待支付 1未支付2已经支付3异常 //=未付款
const STATUS_HAVE_PAY =2; // 已经支付 //=已下单
const STATUS_PAY_EXCEPTION =3; // 支付异常或过期未付 //=关闭订单
const STATUS_PAY_REFUND =4 ; // 退款 //=已过期
const ORDER_DELETED = 5; //订单删除
//------------状态转换-----------------------
const NOT_PAY = 3;//未付款
const HAVE_PAID_ORDER = 4;//已下单
const CLOSED = 7;//关闭订单
const OVERDUE =8;//已过期
}
\ 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\FrontMoney\Lib;
use Hdll\Services\FrontMoney\Enum\FrontOrderEnum;
use Swoft\Core\ResultInterface;
/**
* The interface of demo service
*
* @method ResultInterface deferBackNum(string $token, int $consigneeId, int $frontId, int $selectedNum, int $orderType, int $goodsId, string $reservationTime = '')
* @method ResultInterface deferGetFrontGoods(int $storeId, int $frontId)
* @method ResultInterface deferGetFrontInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $frontId, int $status, int $orderId)
* @method ResultInterface deferGetFrontCounts(int $storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/
interface FrontMoneyInterface
{
/**
*
* 补回 未支付 定金活动 库存
* @param string $token
* @param int $consignee_id
* @param int $front_id
* @param int $selected_num
* @param int $order_type
* @param int $goods_id
* @param string $reservation_time
* @return mixed
*/
public function backNum(string $token, int $consigneeId, int $frontId, int $selectedNum, int $orderType, int $goodsId, string $reservationTime = '');
/**
* 获取定金商品的 商品信息
* @param int $front_id
* @return {
* "name" 名称
* "image" 图片
* "price" 价格
* "activityName" 活动名称
* }
*/
public function getFrontGoods(int $storeId, int $frontId);
/**
* 通过商品id 获取是否 有定金活动
* @param int $storeId
* @param int $goodsId
* @return bool
*
*/
public function getFrontInfo(int $storeId, int $goodsId);
/**
* 支付 状态 回馈接口
* @param string $store_id
* @param int $front_id
* @param int $status // 2.FrontOrderEnum::STATUS_HAVE_PAY 成功支付 3:FrontOrderEnum::STATUS_PAY_EXCEPTION 未支付 (已经过期或者支付异常)4 FrontOrderEnum::STATUS_PAY_REFUND 退款
* @param int $orderId
* @return bool|mixed
* @throws ConException
*/
public function payStatus(string $storeId,int $frontId, int $status, int $orderId);
/**
* 获取定金活动总个数 和正在进行的个数
*
* @return mixed
*/
public function getFrontCounts(int $storeId);
/**
*获取自上次时间以来产生的新订单数
*
* @param [int] $storeId
* @param [int] $lastTime
* @return int
*/
public function getNewOrderNum(int $storeId,int $lastTime);
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Hdll\Services\Goods\Lib; namespace Hdll\Services\Goods\Lib;
use App\Exception\ServiceException;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
...@@ -25,127 +26,128 @@ use Swoft\Core\ResultInterface; ...@@ -25,127 +26,128 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferAdminCountActivity($storeId) * @method ResultInterface deferAdminCountActivity($storeId)
* @method ResultInterface deferGetTopThreeSales($storeId) * @method ResultInterface deferGetTopThreeSales($storeId)
* @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds) * @method ResultInterface deferGetReturnVisitByGoodsIds($storeId, $goodsIds)
* @method ResultInterface deferCountEvaluate($storeId,$time) * @method ResultInterface deferCountEvaluate($storeId, $time)
* @method ResultInterface deferFind($storeId, $id)
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
*/ */
interface GoodsInterface interface GoodsInterface
{ {
/** /**
* 获取商品 * 获取商品
* @param $storeId * @param $storeId
* @return [ * @param $id
* 'gcId' 商品类ID * @return [
* 'asId' 服务ID * 'gcId' 商品类ID
* 'stock' 库存 * 'asId' 服务ID
* 'name' 名称 * 'stock' 库存
* 'image' 图片 * 'name' 名称
* 'price' 价格 * 'image' 图片
* 'state' 状态 * 'price' 价格
* 'body' 描述 * 'state' 状态
* 'originalPrice' 原价 * 'body' 描述
* 'sales' 销量 * 'originalPrice' 原价
* ] * 'sales' 销量
* @param $id * ]
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function get($storeId, $id); public function get($storeId, $id);
/** /**
* 增加商品销量 * 增加商品销量
* 减少商品库存 * 减少商品库存
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function incSales($storeId, $goodsId); public function incSales($storeId, $goodsId);
/** /**
* 减少商品销量 * 减少商品销量
* 增加商品库存 * 增加商品库存
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function decSales($storeId, $goodsId); public function decSales($storeId, $goodsId);
/** /**
* 获取商品服务 * 获取商品服务
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 付款后 2 服务前 3 服务后 * @param $type 1 付款后 2 服务前 3 服务后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getServiceByGoodsId($storeId, $goodsId, $type = 3); public function getServiceByGoodsId($storeId, $goodsId, $type = 3);
/** /**
* 获取用户回访 * 获取用户回访
* @param $storeId * @param $storeId
* @param $goodsId * @param $goodsId
* @param $type 1 之前 2 之后 * @param $type 1 之前 2 之后
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function getReturnVisitByGoodsId($storeId, $goodsId, $type = 2); public function getReturnVisitByGoodsId($storeId, $goodsId, $type = 2);
/** /**
* 获取商品列表 ids * 获取商品列表 ids
* @param $ids * @param $ids
* @param $storeId * @param $storeId
* @param $order * @param $order
* @return mixed * @return mixed
* @author Administrator * @author Administrator
*/ */
public function listByIds(array $ids, $storeId, $order = ['id', 'DESC']); public function listByIds(array $ids, $storeId, $order = ['id', 'DESC']);
/** /**
* 获取sku信息 * 获取sku信息
* @param $skuId * @param $skuId
* @param $goodsId * @param $goodsId
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSkuInfo($skuId, $goodsId, $storeId); public function getSkuInfo($skuId, $goodsId, $storeId);
/** /**
* 获取多个sku信息 * 获取多个sku信息
* @param $goodsId * @param $goodsId
* @param $skuIds * @param $skuIds
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSkuByIds($goodsId, $skuIds, $storeId); public function getSkuByIds($goodsId, $skuIds, $storeId);
public function getSkuByGoodsId($goodsId, $storeId); public function getSkuByGoodsId($goodsId, $storeId);
/** /**
* 获取商品规格属性 * 获取商品规格属性
* @param $goodsId * @param $goodsId
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function getSpecAttributeByGoodsId($goodsId, $storeId); public function getSpecAttributeByGoodsId($goodsId, $storeId);
/** /**
* 添加后续服务模版 * 添加后续服务模版
* @param $storeId * @param $storeId
* @return mixed * @return mixed
* @author work * @author work
*/ */
public function afterServiceTmp($storeId); public function afterServiceTmp($storeId);
/** /**
* 获取商品数量 * 获取商品数量
...@@ -177,4 +179,11 @@ interface GoodsInterface ...@@ -177,4 +179,11 @@ interface GoodsInterface
*/ */
public function getReturnVisitByGoodsIds($storeId, $goodsIds); public function getReturnVisitByGoodsIds($storeId, $goodsIds);
/**
* 获取商品(包括已删除)
* @param $storeId
* @param $id
* @return array|mixed
*/
public function find($storeId, $id);
} }
...@@ -28,9 +28,10 @@ class OrderEnum ...@@ -28,9 +28,10 @@ class OrderEnum
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_CARD = 4; //储值卡购买订单 const TYPE_CARD = 4; //储值卡订单
const TYPE_TIMESCARD = 5; //次卡 const TYPE_TIMESCARD = 5; //次卡订单
const TYPE_DEPOSIT = 6;//定金订单
......
...@@ -31,6 +31,7 @@ use Swoft\Core\ResultInterface; ...@@ -31,6 +31,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetShopDailyStatistic(int $storeId,int $startDate,int $endDate) * @method ResultInterface deferGetShopDailyStatistic(int $storeId,int $startDate,int $endDate)
* @method ResultInterface deferGetShopNewOrderNum(int $storeId) * @method ResultInterface deferGetShopNewOrderNum(int $storeId)
* @method ResultInterface deferOrderCountByCondition(int $storeId,array $condition) * @method ResultInterface deferOrderCountByCondition(int $storeId,array $condition)
* @method ResultInterface deferBuyerSpendAmount(int $storeId,int $buyerId)
*/ */
interface OrderInterface interface OrderInterface
{ {
...@@ -215,4 +216,13 @@ interface OrderInterface ...@@ -215,4 +216,13 @@ interface OrderInterface
* @return int * @return int
*/ */
public function orderCountByCondition(int $storeId,array $condition); public function orderCountByCondition(int $storeId,array $condition);
/**
* 获取用户微信总消费金额
*
* @param integer $storeId
* @param integer $buyerId
* @return int
*/
public function buyerSpendAmount(int $storeId,int $buyerId);
} }
\ No newline at end of file
...@@ -24,6 +24,7 @@ use Swoft\Core\ResultInterface; ...@@ -24,6 +24,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface defermarkReservFinished(int $storeId, int $orderId) * @method ResultInterface defermarkReservFinished(int $storeId, int $orderId)
* @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type) * @method ResultInterface deferAddReservation(int $storeId, int $orderId, int $buyerId, int $cmanId, int $reservTime, string $memo, int $type)
* @method ResultInterface deferCancelReservByOrderId(int $storeId, int $orderId, string $memo) * @method ResultInterface deferCancelReservByOrderId(int $storeId, int $orderId, string $memo)
* @method ResultInterface deferGetReservListByCmanId(int $storeId, int $cmanId, $state = null, $isConfirm = null)
*/ */
interface ReservationInterface interface ReservationInterface
{ {
...@@ -117,4 +118,15 @@ interface ReservationInterface ...@@ -117,4 +118,15 @@ interface ReservationInterface
*/ */
public function cancelReservByOrderId(int $storeId, int $orderId, string $memo = ''); public function cancelReservByOrderId(int $storeId, int $orderId, string $memo = '');
/**
* 根据店员id,获取对应的预约列表
*
* @param integer $storeId
* @param integer $cmanId
* @param integer $state 0:预约未标记完成,1:预约已确定完成
* @Number(name="state")
* @return array
*/
public function getReservListByCmanId(int $storeId, int $cmanId, $state = null, $isConfirm = null);
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ use Swoft\Core\ResultInterface; ...@@ -18,7 +18,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferUpdate($id, $data) * @method ResultInterface deferUpdate($id, $data)
* @method ResultInterface deferCountDistributionNum($sellerId) * @method ResultInterface deferCountDistributionNum($sellerId)
* @method ResultInterface deferGetByIds(array $ids, $fields = ['*']) * @method ResultInterface deferGetByIds(array $ids, $fields = ['*'])
* @method ResultInterface deferGetAndUpdateOpenId($unionId, $openId) * @method ResultInterface deferGetAndUpdateOpenId($unionId, $openId, $fields = ['*'])
* @method ResultInterface deferSaveRelation($sellerId) * @method ResultInterface deferSaveRelation($sellerId)
* @method ResultInterface deferUpdateRelationVip($sellerId, $isVip) * @method ResultInterface deferUpdateRelationVip($sellerId, $isVip)
* @method ResultInterface deferCountVip($sellerId, $isVip) * @method ResultInterface deferCountVip($sellerId, $isVip)
...@@ -87,7 +87,7 @@ interface SellerInterface ...@@ -87,7 +87,7 @@ interface SellerInterface
public function getByIds(array $ids, $fields = ['*']); public function getByIds(array $ids, $fields = ['*']);
public function getAndUpdateOpenId($unionId, $openId); public function getAndUpdateOpenId($unionId, $openId, $fields = ['*']);
public function saveRelation($sellerId); public function saveRelation($sellerId);
......
...@@ -11,5 +11,5 @@ namespace Hdll\Services\SellerDistribution\Enum; ...@@ -11,5 +11,5 @@ namespace Hdll\Services\SellerDistribution\Enum;
class SellerDistributionEnum class SellerDistributionEnum
{ {
const SETTING = [1 => 0.4, 2 => 0.25]; const SETTING = [1 => 0.2, 2 => 0.1];
} }
\ 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