Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
services
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tencent
services
Commits
a4439976
Commit
a4439976
authored
Jul 01, 2020
by
王召彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into fixbug
parents
34b4e04f
744740b3
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
183 additions
and
13 deletions
+183
-13
UPGRADE_2.x.md
+18
-0
src/Comments/Lib/CommentsInterface.php
+2
-1
src/Common/Config/Bean/PathConfig.php
+41
-4
src/Common/Entity/User.php
+10
-0
src/Common/Lib/Xcrypt.php
+6
-3
src/CustomerProfiles/Lib/ProfileInterface.php
+10
-0
src/Goods/Lib/GoodsInterface.php
+12
-2
src/Order/Lib/OrderInterface.php
+57
-0
src/Recharge/Lib/RechargeInterface.php
+15
-1
src/Store/Lib/StoreInterface.php
+10
-0
src/V2/Common/Config/CfgCenter.php
+2
-2
No files found.
UPGRADE_2.x.md
View file @
a4439976
# 2.0.70
-
划卡收益明细优化上线
# 2.0.69
-
商品销售数量
# 2.0.68
-
实物订单改运费/流量平台分地区 上线
# 2.0.67
-
流量平台迁移业务员
# 2.0.66
-
添加getStoreByCondition接口
# 2.0.65
-
流量平台商品
# 2.0.64
-
修改sgo函数
...
...
src/Comments/Lib/CommentsInterface.php
View file @
a4439976
...
...
@@ -19,7 +19,7 @@ interface CommentsInterface
* [1=>['virtual'=>1,'real'=>2]]
* @throws BaseException
*/
public
function
getNum
(
array
$itemIds
);
public
function
getNum
(
array
$itemIds
,
$oemId
=
0
);
}
\ No newline at end of file
src/Common/Config/Bean/PathConfig.php
View file @
a4439976
...
...
@@ -5,7 +5,7 @@
* Date: 2018/7/16
* Time: 11:09
*/
$basePath
=
dirname
(
__DIR__
,
3
);
$basePath
=
dirname
(
__DIR__
,
3
);
/**
* 用于自建组件扫描路径配置(键值是方便开发人员理解,代码中无意义)
...
...
@@ -15,7 +15,45 @@ $basePath = dirname(__DIR__,3);
*
* ];
*/
if
(
!
function_exists
(
'buildNotice'
)){
function
buildNotice
(
$msg
)
{
$jsonStr
=
json_encode
([
'msgtype'
=>
'text'
,
'text'
=>
[
'content'
=>
$msg
]
]);
$url
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=97225115-5aa1-47e9-a029-04d0c25abb47"
;
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_POST
,
1
);
curl_setopt
(
$ch
,
CURLOPT_URL
,
$url
);
curl_setopt
(
$ch
,
CURLOPT_POSTFIELDS
,
$jsonStr
);
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/json; charset=utf-8'
,
'Content-Length: '
.
strlen
(
$jsonStr
)
)
);
$response
=
curl_exec
(
$ch
);
$httpCode
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
curl_close
(
$ch
);
return
array
(
$httpCode
,
$response
);
}
}
try
{
if
(
!
env
(
"NOT_NOTICE"
)
&&
posix_getpid
()
==
16
)
{
$msg
=
"环境:"
.
env
(
"ENVIRONMENT"
)
.
" 项目名称:"
.
APP_NAME
.
"————构建成功!"
;
buildNotice
(
$msg
);
}
}
catch
(
Exception
$e
)
{
var_dump
(
$e
->
getMessage
());
}
return
[
'commonPath'
=>
$basePath
.
'/Common'
,
'commonPath'
=>
$basePath
.
'/Common'
,
];
\ No newline at end of file
];
src/Common/Entity/User.php
View file @
a4439976
...
...
@@ -140,6 +140,11 @@ class User
$this
->
setValue
(
'subStoreId'
,
$value
);
}
public
function
setRgId
(
$value
)
{
return
$this
->
setValue
(
'rgId'
,
$value
);
}
public
function
getSubStoreId
()
{
return
$this
->
getValue
(
'subStoreId'
)
??
0
;
...
...
@@ -193,6 +198,11 @@ class User
return
$this
->
getValue
(
'scope'
);
}
public
function
getRgId
()
{
return
$this
->
getValue
(
'rgId'
);
}
/**
* 是否是通过托管的小程序授权
*
...
...
src/Common/Lib/Xcrypt.php
View file @
a4439976
...
...
@@ -2,8 +2,7 @@
namespace
Hdll\Services\Common\Lib
;
use
Hdll\Services\Common\Config\CfgCenter
;
use
Swoft\App
;
use
Swoft\Redis\Redis
;
use
Hdll\Services\V2\Common\Config\CfgCenter
as
CfgCenter2
;
class
Xcrypt
{
...
...
@@ -39,7 +38,11 @@ class Xcrypt
}
private
static
function
getKey
(){
$key
=
CfgCenter
::
getByOemId
(
CfgCenter
::
ENCRYPT_KEY
,
0
);
if
(
class_exists
(
'\Swoft\App'
))
{
$key
=
CfgCenter
::
getByOemId
(
CfgCenter
::
ENCRYPT_KEY
,
0
);
}
else
{
$key
=
CfgCenter2
::
getByOemId
(
CfgCenter
::
ENCRYPT_KEY
,
0
);
}
if
(
empty
(
$key
)){
throw
new
\Exception
(
'加密密钥获取失败!'
);
}
...
...
src/CustomerProfiles/Lib/ProfileInterface.php
View file @
a4439976
...
...
@@ -11,6 +11,7 @@
namespace
Hdll\Services\CustomerProfiles\Lib
;
use
App\Exception\ConException
;
use
Swoft\Core\ResultInterface
;
/**
...
...
@@ -51,4 +52,12 @@ interface ProfileInterface
*/
public
function
getProfile
(
$storeId
,
$buyerId
);
/**
* 店员统计信息
* @param $storeId
* @param $cmanId
* @return mixed
*/
public
function
cmanCount
(
$storeId
,
$cmanId
);
}
\ No newline at end of file
src/Goods/Lib/GoodsInterface.php
View file @
a4439976
...
...
@@ -63,20 +63,22 @@ interface GoodsInterface
* 减少商品库存
* @param $storeId
* @param $goodsId
* @param $num
* @return mixed
* @author Administrator
*/
public
function
incSales
(
$storeId
,
$goodsId
);
public
function
incSales
(
$storeId
,
$goodsId
,
$num
=
1
);
/**
* 减少商品销量
* 增加商品库存
* @param $storeId
* @param $goodsId
* @param $num
* @return mixed
* @author Administrator
*/
public
function
decSales
(
$storeId
,
$goodsId
);
public
function
decSales
(
$storeId
,
$goodsId
,
$num
=
1
);
/**
...
...
@@ -217,4 +219,12 @@ interface GoodsInterface
* @return mixed
*/
public
function
sumGoodsPrice
(
$storeId
,
$goods
);
/**
* 添加商品
* @param $storeId
* @param $param
* @return mixed
*/
public
function
add
(
$storeId
,
$param
);
}
src/Order/Lib/OrderInterface.php
View file @
a4439976
...
...
@@ -33,6 +33,8 @@ use Swoft\Core\ResultInterface;
* @method ResultInterface deferOrderCountByCondition(int $storeId,array $condition)
* @method ResultInterface deferBuyerSpendAmount(int $storeId,int $buyerId)
* @method ResultInterface deferBanchGetShopStByDate(array $storeIds,int $date)
* @method ResultInterface deferGetReceiverLog($storeId, $tradeSn)
* @method ResultInterface deferPostagePaySuccess(int $storeId, array $payData)
*/
interface
OrderInterface
{
...
...
@@ -245,4 +247,58 @@ interface OrderInterface
* ]
*/
public
function
banchGetShopStByDate
(
array
$storeIds
,
int
$date
);
/**
* 查询订单收货人修改记录
* @param int $storeId
* @param string $tradeSn
* @return array
*/
public
function
getReceiverLog
(
$storeId
,
$tradeSn
);
/**
* 运费补差价支付成功回调
*
* @param int $storeId
* @param array $payData
* @return void
*/
public
function
postagePaySuccess
(
int
$storeId
,
array
$payData
);
/**
* 根据订单id获取概括汇总的标题
* 示例:时尚新品板鞋...等3件商品
* @param int $storeId
* @param array $subOrderIds
* @param array $mainOrderIds 可以不传
* @return array
*/
public
function
getSummaryTitles
(
int
$storeId
,
array
$subOrderIds
,
array
$mainOrderIds
=
[]);
/**
* 用于其他服务在没有订单的情况下,添加核销记录
*
* @param integer $storeId
* @param integer $cmanId 核销的店员id
* @param integer $amount 核销的金额
* @param integer $payOrigin 参加枚举 PayOriginEnum::CARD
* @param integer $orderClass 参加枚举类 OrderEnum::CLASS_PHYSICAL
* @param array $goodsInfo 示例:['goodsId':333, 'name':'酷酷酷', 'image':'xxxxxx']
* @return void
*/
public
function
addDeliverdLog
(
int
$storeId
,
int
$cmanId
,
int
$amount
,
int
$payOrigin
,
int
$orderClass
,
array
$goodsInfo
);
/**
* 根据商品id和核销数量添加核销记录
*
* @param integer $storeId
* @param integer $cmanId 核销的店员id
* @param integer $payOrigin 参加枚举 PayOriginEnum::CARD
* @param array $goodsNums 核销的商品数量 [['id':0, 'num':1, 'name':'划卡', 'amout':56], ['id':45, 'num':2, 'name':'', 'amout':0]]
* @return bool
*/
public
function
addDeliverdLogByGoods
(
int
$storeId
,
int
$cmanId
,
int
$payOrigin
,
array
$goodsNums
);
}
\ No newline at end of file
src/Recharge/Lib/RechargeInterface.php
View file @
a4439976
...
...
@@ -54,9 +54,10 @@ interface RechargeInterface
* ],
* ]
* @param int $parentOrderId // 主订单id
* @param int $extraFee 额外的费用,比如运费等
* @return mixed
*/
public
function
spendCardMoney
(
int
$storeId
,
int
$buyerId
,
array
$subOrders
,
int
$parentOrderId
);
public
function
spendCardMoney
(
int
$storeId
,
int
$buyerId
,
array
$subOrders
,
int
$parentOrderId
,
int
$extraFee
=
0
);
/**
* 退回储值卡金额
...
...
@@ -71,6 +72,19 @@ interface RechargeInterface
public
function
ReturnCardMoney
(
int
$storeId
,
int
$buyerId
,
int
$itemOrderId
,
string
$itemTitle
,
int
$payMoney
,
int
$parentOrderId
);
/**
* 储值卡指定金额退款
* @param $storeId
* @param $buyerId
* @param $amount // 退还金额
* @param $refundTitle // 退款标题
* @param $parentOrderId // 主订单
* @param $subOrderId // 子订单
* @return bool
* @throws
*/
public
function
refundAmount
(
int
$storeId
,
int
$buyerId
,
int
$amount
,
$refundTitle
,
$parentOrderId
=
0
,
$subOrderId
=
0
);
/**
* 统计储值卡上架数/总数
* @param int $storeId
* @return mixed
...
...
src/Store/Lib/StoreInterface.php
View file @
a4439976
...
...
@@ -230,4 +230,13 @@ interface StoreInterface
*/
public
function
getStoreCount
(
int
$startTime
,
int
$endTime
,
$edition
=
null
,
$oemId
=
0
);
/**
* 修改店铺的业务员id
*
* @param integer $oldSmId
* @param integer $newSmId
* @return integer
*/
public
function
changeSalesmanId
(
int
$oldSmId
,
int
$newSmId
);
}
\ No newline at end of file
src/V2/Common/Config/CfgCenter.php
View file @
a4439976
...
...
@@ -212,9 +212,9 @@ class CfgCenter
if
(
$valArr
)
{
//有内容时进行redis缓存
if
(
is_array
(
$valArr
))
{
$valArr
[
'oemId'
]
=
$oemId
;
//需要将oemId加入配置返回
Redis
::
set
(
$prefix
.
$keyName
,
json_encode
(
$valArr
),
360
0
);
Redis
::
set
(
$prefix
.
$keyName
,
json_encode
(
$valArr
),
6
0
);
}
else
{
Redis
::
set
(
$prefix
.
$keyName
,
$valArr
,
360
0
);
Redis
::
set
(
$prefix
.
$keyName
,
$valArr
,
6
0
);
}
}
return
$valArr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment