Commit 71d1c1db by xmy

Merge branch 'ft-oem'

parents 96a5df5f 0f39e34f
<?php
namespace Hdll\Services\ApiService\Lib;
use Swoft\Core\ResultInterface;
/**
* Interface OemInterface
* @package Hdll\Services\Lib\ApiService
*/
interface OemInterface
{
/**
* 获取oem信息
* @param $oemId
* @return mixed
*/
public function getOem($oemId);
}
\ No newline at end of file
...@@ -18,8 +18,9 @@ use Swoft\Core\ResultInterface; ...@@ -18,8 +18,9 @@ use Swoft\Core\ResultInterface;
* *
* @method ResultInterface deferGetgoodsInfo(int $storeId, int $bargain_id) * @method ResultInterface deferGetgoodsInfo(int $storeId, int $bargain_id)
* @method ResultInterface deferGetBargainInfo(int $storeId, int $goodsId) * @method ResultInterface deferGetBargainInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $bargainbranchId,int $status, int $orderId) * @method ResultInterface deferPayStatus(string $storeId,int $bargainbranchId,int $status, int $orderId)
* @method ResultInterface deferGetBargainCounts(int $storeId) * @method ResultInterface deferGetBargainCounts(int $storeId)
* @method ResultInterface deferGetNotEndedActivityList($storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime) * @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/ */
interface BargainInterface interface BargainInterface
...@@ -64,6 +65,13 @@ interface BargainInterface ...@@ -64,6 +65,13 @@ interface BargainInterface
*/ */
public function getBargainCounts(int $storeId); public function getBargainCounts(int $storeId);
/**
* 获取店铺尚未结束的活动列表
*
* @return mixed
*/
public function getNotEndedActivityList($storeId);
/** /**
*获取自上次时间以来产生的新订单数 *获取自上次时间以来产生的新订单数
* *
......
...@@ -37,6 +37,11 @@ class User ...@@ -37,6 +37,11 @@ class User
return $this->getValue('id'); return $this->getValue('id');
} }
public function getOemId()
{
return $this->getValue('oemId');
}
public function setTestFlag() public function setTestFlag()
{ {
$this->setValue('testFlag', TestEnum::TEST_STORE_ID); $this->setValue('testFlag', TestEnum::TEST_STORE_ID);
......
...@@ -8,9 +8,6 @@ use Swoft\Redis\Redis; ...@@ -8,9 +8,6 @@ use Swoft\Redis\Redis;
class Xcrypt class Xcrypt
{ {
const CRYPT = 'cryptKey';
public static function encrypt(string $str, $key = '') public static function encrypt(string $str, $key = '')
{ {
$str = serialize($str); $str = serialize($str);
...@@ -42,10 +39,10 @@ class Xcrypt ...@@ -42,10 +39,10 @@ class Xcrypt
} }
private static function getKey(){ private static function getKey(){
$key = CfgCenter::get(self::CRYPT); $key = CfgCenter::getByOemId(CfgCenter::ENCRYPT_KEY, 0);
if (empty($key)){ if (empty($key)){
throw new \Exception('加密密钥获取失败!'); throw new \Exception('加密密钥获取失败!');
} }
return $key; return $key;
} }
} }
\ No newline at end of file \ 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 user
*
* @Bean()
*/
class ApiServicePoolConfig extends PoolProperties
{
public function __construct()
{
// 区别本地和线上的RPC服务地址
// $this->uri = explode(',', env('RPC_GROUPBOOKING_URI', '172.21.0.38:8099,172.16.255.27:8099'));
$this->uri = explode(',', env('RPC_API_SERVICE_URI', 'apiService:8099'));
}
protected $name = 'apiService';
/**
* 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 = [
'192.168.3.39:8200',
];
/**
* 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,6 +21,7 @@ use Swoft\Core\ResultInterface; ...@@ -21,6 +21,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetFrontInfo(int $storeId, int $goodsId) * @method ResultInterface deferGetFrontInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $storeId,int $frontId, int $status, int $orderId) * @method ResultInterface deferPayStatus(string $storeId,int $frontId, int $status, int $orderId)
* @method ResultInterface deferGetFrontCounts(int $storeId) * @method ResultInterface deferGetFrontCounts(int $storeId)
* @method ResultInterface deferGetNotEndedActivityList($storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime) * @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/ */
interface FrontMoneyInterface interface FrontMoneyInterface
...@@ -80,6 +81,13 @@ interface FrontMoneyInterface ...@@ -80,6 +81,13 @@ interface FrontMoneyInterface
*/ */
public function getFrontCounts(int $storeId); public function getFrontCounts(int $storeId);
/**
* 获取店铺尚未结束的活动列表
*
* @return mixed
*/
public function getNotEndedActivityList($storeId);
/** /**
*获取自上次时间以来产生的新订单数 *获取自上次时间以来产生的新订单数
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Hdll\Services\GroupBooking\Lib; namespace Hdll\Services\GroupBooking\Lib;
use App\Exception\ServiceException;
use Swoft\Core\ResultInterface; use Swoft\Core\ResultInterface;
/** /**
...@@ -15,6 +16,7 @@ use Swoft\Core\ResultInterface; ...@@ -15,6 +16,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferHasActivity($storeId, $goodsId) * @method ResultInterface deferHasActivity($storeId, $goodsId)
* @method ResultInterface deferAdminCountActivity($storeId) * @method ResultInterface deferAdminCountActivity($storeId)
* @method ResultInterface deferGetNewOrderNum($storeId, $time) * @method ResultInterface deferGetNewOrderNum($storeId, $time)
* @method ResultInterface deferGetOnGoing($storeId, $fields = ['*'])
* Interface GoodsInterface * Interface GoodsInterface
* @package Hdll\Services\Goods\Lib * @package Hdll\Services\Goods\Lib
*/ */
...@@ -59,4 +61,13 @@ interface GroupBookingInterface ...@@ -59,4 +61,13 @@ interface GroupBookingInterface
* @return number * @return number
*/ */
public function getNewOrderNum($storeId, $time); public function getNewOrderNum($storeId, $time);
/**
* 获取进行中的活动
* @param $storeId
* @param array $fields
* @return mixed
*/
public function getOnGoing($storeId, $fields = ['*']);
} }
\ No newline at end of file
...@@ -21,6 +21,7 @@ use Swoft\Core\ResultInterface; ...@@ -21,6 +21,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferGetLimitInfo(int $storeId, int $goodsId) * @method ResultInterface deferGetLimitInfo(int $storeId, int $goodsId)
* @method ResultInterface deferPayStatus(string $store_id,int $limit_id, int $status, int $orderId) * @method ResultInterface deferPayStatus(string $store_id,int $limit_id, int $status, int $orderId)
* @method ResultInterface deferGetLimitCounts(int $storeId) * @method ResultInterface deferGetLimitCounts(int $storeId)
* @method ResultInterface deferGetNotEndedActivityList($storeId)
* @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime) * @method ResultInterface deferGetNewOrderNum(int $storeId,int $lastTime)
*/ */
interface LimitTimeBuyInterface interface LimitTimeBuyInterface
...@@ -86,6 +87,13 @@ interface LimitTimeBuyInterface ...@@ -86,6 +87,13 @@ interface LimitTimeBuyInterface
*/ */
public function getLimitCounts(int $storeId); public function getLimitCounts(int $storeId);
/**
* 获取店铺尚未结束的活动列表
*
* @return mixed
*/
public function getNotEndedActivityList($storeId);
/** /**
*获取自上次时间以来产生的新订单数 *获取自上次时间以来产生的新订单数
......
...@@ -7,6 +7,7 @@ use Swoft\Core\ResultInterface; ...@@ -7,6 +7,7 @@ use Swoft\Core\ResultInterface;
/** /**
* @method ResultInterface deferAdminCountActivity($storeId) * @method ResultInterface deferAdminCountActivity($storeId)
* @method ResultInterface deferGetNewOrderNum($storeId, $time) * @method ResultInterface deferGetNewOrderNum($storeId, $time)
* @method ResultInterface deferGetOnGoing($storeId, $fields = ['*'])
* Class LotteryInterface * Class LotteryInterface
* @package Hdll\Services\Lottery\Lib * @package Hdll\Services\Lottery\Lib
*/ */
...@@ -35,4 +36,12 @@ interface LotteryInterface ...@@ -35,4 +36,12 @@ interface LotteryInterface
* @author work * @author work
*/ */
public function getNewOrderNum($storeId, $time); public function getNewOrderNum($storeId, $time);
/**
* 获取正在进行的活动
* @param $storeId
* @param array $fields
* @return mixed
*/
public function getOnGoing($storeId, $fields = ['*']);
} }
\ No newline at end of file
<?php
namespace Hdll\Services\MemberCard\Enum;
class UpBonusEvent {
const CONSUME_ADD = 1; //消费产生积分(确认收货)
const CONSUME_PAY = 2; //下单减积分
const CLOSE_ORDER = 3; //关闭订单返还积分
}
\ No newline at end of file
...@@ -25,6 +25,10 @@ use Swoft\Core\ResultInterface; ...@@ -25,6 +25,10 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferSetUserCouponStatus(int $storeId,int $couponId,int $status) * @method ResultInterface deferSetUserCouponStatus(int $storeId,int $couponId,int $status)
* @method ResultInterface deferGetUserValidCouponNum(int $storeId,int $escrow,int $userId) * @method ResultInterface deferGetUserValidCouponNum(int $storeId,int $escrow,int $userId)
* @method ResultInterface deferIfCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods) * @method ResultInterface deferIfCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods)
* @method ResultInterface deferUpMembercardBonus(int $storeId,int $userId,int $orderId,int $type,int $money=0,int $bonus=0)
* @method ResultInterface deferUpMembercardBalance(int $storeId,int $escrow,int $userId,int $balance)
* @method ResultInterface deferGetBonusConvertMoney((int $storeId,int $userId,int $bonusToUse)
* @method ResultInterface deferVerifyBonusConvertMoney((int $storeId,int $userId,int $bonusToUse,int $price)
*/ */
/** /**
* The interface of demo service * The interface of demo service
...@@ -120,4 +124,48 @@ interface MemberCardInterface ...@@ -120,4 +124,48 @@ interface MemberCardInterface
*/ */
public function ifCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods); public function ifCouponSuitOrder(int $storeId,int $userId,int $couponId,array $goods);
/**
* 改变用户积分
*
* @param integer $storeId
* @param integer $userId
* @param integer $orderId
* @param integer $type //类型 1 消费产生积分 2 积分抵扣 3订单关闭 (这里只要传1-3) 枚举见 UpBonusEvent
* @param integer $money //类型1 只要传money,bonus不传; 类型2 money=0,bonus 传; 类型3 money,bonus都不传
* @param integer $bonus
* @return bool
*/
public function upMembercardBonus(int $storeId,int $userId,int $orderId,int $type,int $money=0,int $bonus=0);
/**
* 用户储值卡余额 通知会员卡(显示在卡包 余额)
*
* @param integer $storeId
* @param integer $escrow
* @param integer $userId
* @param integer $balance
* @return bool
*/
public function upMembercardBalance(int $storeId,int $escrow,int $userId,int $balance);
/**
* 下单时 查询 积分能抵扣的金额
*
* @param integer $storeId
* @param integer $userId
* @param integer $bonusToUse
* @return int
*/
public function getBonusConvertMoney(int $storeId,int $userId,int $bonusToUse);
/**
* 下单时 验证 积分能抵扣的金额
*
* @param integer $storeId
* @param integer $userId
* @param integer $bonusToUse
* @param integer $price //订单原价减去优惠券后的价格
* @return bool //验证通过返回true,不通过返回false
*/
public function verifyBonusConvertMoney(int $storeId,int $userId,int $bonusToUse,int $price);
} }
...@@ -34,5 +34,14 @@ class NoticeEnum ...@@ -34,5 +34,14 @@ class NoticeEnum
self::TYPE_SYSTEM_SEND, self::TYPE_SYSTEM_SEND,
]; ];
const PAGE_TYPE_BACKEND = 1;//后台 蓝猫
const PAGE_TYPE_FRONT = 2;//前台 橙猫
const PAGE_TYPE_MP = 3;//公众号
const TEMPLATE_GROUP_BOOKING_SUCCESS = "GROUP_BOOKING_SUCCESS";//拼团结果通知
const TEMPLATE_BARGAIN_OVERDUE = "BARGAIN_OVERDUE"; //砍价活动过期通知
const TEMPLATE_BARGAIN_COMPLETE = "BARGAIN_COMPLETE";//砍到底价通知
const TEMPLATE_TIMESCARD_PADDLE = "TIMESCARD_PADDLE";//次卡划卡通知
const TEMPLATE_RECHARGE_PADDLE = "RECHARGE_PADDLE";//储值卡划卡通知
} }
\ No newline at end of file
...@@ -17,27 +17,40 @@ use Swoft\Core\ResultInterface; ...@@ -17,27 +17,40 @@ use Swoft\Core\ResultInterface;
* *
* @method ResultInterface deferSend(int $storeId, array $sendTypes, array $data, $sendTime, string $redisKey) :bool * @method ResultInterface deferSend(int $storeId, array $sendTypes, array $data, $sendTime, string $redisKey) :bool
* @method ResultInterface deferCancelSend(string $redisKey):bool * @method ResultInterface deferCancelSend(string $redisKey):bool
* @method ResultInterface deferCostumerSend(string $openId); * @method ResultInterface deferCostumerSend(string $openId, int $oemId = 0);
*/ */
interface NoticeInterface interface NoticeInterface
{ {
/** /**
* 参数说明 * 参数说明
* *
* thing.DATA 事物 20个以内字符 可汉字、数字、字母或符号组合
number.DATA 数字 32位以内数字 只能数字,可带小数
letter.DATA 字母 32位以内字母 只能字母
symbol.DATA 符号 5位以内符号 只能符号
character_string.DATA 字符串 32位以内数字、字母或符号 可数字、字母或符号组合
time.DATA 时间 24小时制时间格式(支持+年月日) 例如:15:01,或:2019年10月1日 15:01
date.DATA 日期 年月日格式(支持+24小时制时间) 例如:2019年10月1日,或:2019年10月1日 15:01
amount.DATA 金额 1个币种符号+10位以内纯数字,可带小数,结尾可带“元” 可带小数
phone_number.DATA 电话 17位以内,数字、符号 电话号码,例:+86-0766-66888866
car_number.DATA 车牌 8位以内,第一位与最后一位可为汉字,其余为字母或数字 车牌号码:粤A8Z888挂
name.DATA 姓名 10个以内纯汉字或20个以内纯字母或符号 中文名10个汉字内;纯英文名20个字母内;中文和字母混合按中文名算,10个字内
phrase.DATA 汉字 5个以内汉字 5个以内纯汉字,例如:配送中
*
* 微信发送消息数据结构 * 微信发送消息数据结构
* $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [ * $data[NoticeEnum::TYPE_MINI_BACKEND_SEND] = [
"uid" => 1, //用户的id "uid" => 1, //用户的id
* "storeId" => 1, //店铺id * "storeId" => 1, //店铺id
"template_id" => "1kZ_RkkWfRrpufXNdmJYBpIhgk7ccCtPrypeJQ9WRwM",//消息模板id "tplName" => ''//订阅模版枚举
"page" => "index", //消息模板页面 "params" => [a=>'b'], //跳转页面参数
"data" => [ //消息模板数据 "data" => [ //消息模板数据
"keyword1" => [ "number01" => [
"value" => "商品名称", "value" => "商品名称",
], ],
"keyword2" => [ "date01" => [
"value" => "A8204427546131350100", "value" => "A8204427546131350100",
], ],
"keyword3" => [ "site01" => [
"value" => "¥30", "value" => "¥30",
], ],
"keyword4" => [ "keyword4" => [
...@@ -64,11 +77,8 @@ interface NoticeInterface ...@@ -64,11 +77,8 @@ interface NoticeInterface
* 微信公众号发送实例 * 微信公众号发送实例
$data[NoticeEnum::TYPE_MP_SEND] = [ $data[NoticeEnum::TYPE_MP_SEND] = [
'unionId' => 'o3lFcs8xoWfQUlhzTiP5uZI6A7Hc', //填写用户的unionId 'unionId' => 'o3lFcs8xoWfQUlhzTiP5uZI6A7Hc', //填写用户的unionId
'template_id' => 'zwUBuoKVRJkumLwGkippA46XfmLsmwJD906HC-wqOks', 'tplName' => 模版KEY,
'miniprogram' => [ 'params' => [],//小程序或url地址参数(不用传地址)array
'appid' => 'wx3b3b2df942634cdd', //小程序appid
'pagepath' => 'pages/start/start'//小程序页面
],
'data' => [ 'data' => [
'first' => 'first', 'first' => 'first',
'keyword1' => '姓名', 'keyword1' => '姓名',
...@@ -101,13 +111,14 @@ interface NoticeInterface ...@@ -101,13 +111,14 @@ interface NoticeInterface
public function send(array $sendTypes, array $data, $sendTime, string $redisKey='') :bool; public function send(array $sendTypes, array $data, $sendTime, string $redisKey='') :bool;
/** /**
* 公众号客服消息 * 公众号客服消息
* *
* @param string $openId * @param string $openId
* @return void * @param int $oemId
*/ * @return void
public function costumerSend(string $openId); */
public function costumerSend(string $openId, int $oemId = 0);
/** /**
......
...@@ -20,6 +20,7 @@ use Swoft\Core\ResultInterface; ...@@ -20,6 +20,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferReturnCardMoney(int $storeId,int $buyerId,int $itemOrderId,string $itemTitle,int $payMoney, int $parentOrderId) * @method ResultInterface deferReturnCardMoney(int $storeId,int $buyerId,int $itemOrderId,string $itemTitle,int $payMoney, int $parentOrderId)
* @method ResultInterface deferStatisNum(int $storeId) * @method ResultInterface deferStatisNum(int $storeId)
* @method ResultInterface deferGetRecharge(int $storeId, int $buyerId) * @method ResultInterface deferGetRecharge(int $storeId, int $buyerId)
* @method ResultInterface deferDeductMoney($storeId, $buyerId, $name, $phone, $money, $message)
*/ */
interface RechargeInterface interface RechargeInterface
{ {
...@@ -88,6 +89,18 @@ interface RechargeInterface ...@@ -88,6 +89,18 @@ interface RechargeInterface
* @return mixed * @return mixed
*/ */
public function getRecharge(int $storeId, int $buyerId); public function getRecharge(int $storeId, int $buyerId);
/**
* 线下扣款(划卡)
* @param int $storeId
* @param int $buyerId
* @param $name
* @param $phone
* @param $money
* @param $message
* @return mixed
*/
public function deductMoney($storeId, $buyerId, $name, $phone, $money, $message);
} }
......
...@@ -22,6 +22,7 @@ use Swoft\Core\ResultInterface; ...@@ -22,6 +22,7 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface defergetTimesCardUserCardInfo(int $storeId, int $goodsId) * @method ResultInterface defergetTimesCardUserCardInfo(int $storeId, int $goodsId)
* @method ResultInterface deferStatisNum(int $storeId) * @method ResultInterface deferStatisNum(int $storeId)
* @method ResultInterface deferValidNum(int $storeId, int $buyerId) * @method ResultInterface deferValidNum(int $storeId, int $buyerId)
* @method ResultInterface deferDeductCard($storeId, $buyerId, $items)
*/ */
interface TimesCardInterface interface TimesCardInterface
{ {
...@@ -86,6 +87,17 @@ interface TimesCardInterface ...@@ -86,6 +87,17 @@ interface TimesCardInterface
* @return mixed * @return mixed
*/ */
public function validNum(int $storeId, int $buyerId); public function validNum(int $storeId, int $buyerId);
/**
* 线下扣卡次数(划卡)
* @param $storeId
* @param $buyerId
* @param $name
* @param $phone
* @param $items
* @return mixed
*/
public function deductCard($storeId, $buyerId, $name, $phone, $items);
} }
......
...@@ -17,7 +17,9 @@ class TransferEnum ...@@ -17,7 +17,9 @@ class TransferEnum
const ORIGIN_FRONTEND = 1; //前台打款 const ORIGIN_FRONTEND = 1; //前台打款
const ORIGIN_BACKEND = 2; //前台打款 const ORIGIN_BACKEND = 2; //后端打款
const ORIGIN_WRWD = 3; //万人万店打款 const ORIGIN_WRWD = 3; //万人万店打款
const ORIGIN_ENTRUSTED = 4;//托管小程序打款
} }
\ No newline at end of file
<?php
namespace Hdll\Services\Vip\Lib;
use Swoft\Core\ResultInterface;
/**
*
* Interface OemVipInterface
* @package Hdll\Services\Vip\Lib
*/
interface OemVipInterface
{
public function getOrder($id);
}
\ No newline at end of file
...@@ -25,4 +25,10 @@ interface VipInterface ...@@ -25,4 +25,10 @@ interface VipInterface
public function getVip(int $vipId); public function getVip(int $vipId);
public function tryVipCountByReferId(int $referId); public function tryVipCountByReferId(int $referId);
public function getVipByOemId($oemId);
public function updateByOemId($oemId, $price);
public function saveByOemId($oemId, $price);
} }
\ 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