Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
f46bbfa8
Commit
f46bbfa8
authored
Sep 10, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' of
https://gitlab.yidian-inc.com/bp/goods
into colonel
parents
81856500
bec6095d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+2
-2
Colonelwallet.php
application/modules/Job/controllers/Colonelwallet.php
+23
-13
cli.ini
conf/cli.ini
+4
-0
No files found.
application/modules/Job/controllers/Colonelorder.php
View file @
f46bbfa8
...
@@ -234,7 +234,7 @@ class ColonelorderController extends Job
...
@@ -234,7 +234,7 @@ class ColonelorderController extends Job
$res
=
Idgen
::
get
(
appConfig
(
'idgen.partner'
),
appConfig
(
'idgen.key'
),
[],
$httpParams
);
$res
=
Idgen
::
get
(
appConfig
(
'idgen.partner'
),
appConfig
(
'idgen.key'
),
[],
$httpParams
);
$ids
=
$res
[
'id_datetime'
][
'goods'
]
??
[];
$ids
=
$res
[
'id_datetime'
][
'goods'
]
??
[];
if
(
$count
>
count
(
$ids
))
{
if
(
$count
>
count
(
$ids
))
{
throw
new
Exception
(
'请求idgen服务失败,
request:'
.
json_encode
(
$httpParams
)
.
';response:'
.
json_encode
(
$res
)
);
throw
new
Exception
(
'请求idgen服务失败,
'
.
[
'req'
=>
$httpParams
,
'res'
=>
$res
]
);
}
}
foreach
(
$data
as
$key
=>
$item
)
{
foreach
(
$data
as
$key
=>
$item
)
{
$data
[
$key
][
'pay_info_trade_id'
]
=
$ids
[
$key
];
$data
[
$key
][
'pay_info_trade_id'
]
=
$ids
[
$key
];
...
@@ -288,7 +288,7 @@ class ColonelorderController extends Job
...
@@ -288,7 +288,7 @@ class ColonelorderController extends Job
$response
=
HttpUtil
::
post
(
$url
,
$httpParams
,
100000
,
3
);
$response
=
HttpUtil
::
post
(
$url
,
$httpParams
,
100000
,
3
);
$this
->
loggerInfo
(
"url=
$url
,request="
.
json_encode
(
$httpParams
)
.
";response="
.
json_encode
(
$response
));
$this
->
loggerInfo
(
"url=
$url
,request="
.
json_encode
(
$httpParams
)
.
";response="
.
json_encode
(
$response
));
if
(
!
isset
(
$response
[
'response'
][
'result'
][
'capital_pool_total'
]))
{
if
(
!
isset
(
$response
[
'response'
][
'result'
][
'capital_pool_total'
]))
{
throw
new
Exception
(
'没有获取到资金池信息
'
);
throw
new
Exception
(
'没有获取到资金池信息
,'
.
[
'req'
=>
$httpParams
,
'res'
=>
$response
]
);
}
}
$result
=
$response
[
'response'
][
'result'
];
$result
=
$response
[
'response'
][
'result'
];
$balance
=
(
$result
[
'capital_pool_total'
]
-
$result
[
'capital_pool_lock'
]
-
$result
[
'capital_pool_used'
]);
$balance
=
(
$result
[
'capital_pool_total'
]
-
$result
[
'capital_pool_lock'
]
-
$result
[
'capital_pool_used'
]);
...
...
application/modules/Job/controllers/Colonelwallet.php
View file @
f46bbfa8
...
@@ -16,6 +16,8 @@ class ColonelwalletController extends Job
...
@@ -16,6 +16,8 @@ class ColonelwalletController extends Job
const
CAPITAL_POOL_OP
=
200
;
//200:团长奖励
const
CAPITAL_POOL_OP
=
200
;
//200:团长奖励
const
WALLET_SERVICE_NAME
=
10
;
// 10生活圈优惠券,11营销活动
const
WALLET_SERVICE_NAME
=
10
;
// 10生活圈优惠券,11营销活动
const
WALLET_SOURCE_NAME
=
1
;
//使用方名,1生活圈,2主端
const
WALLET_SOURCE_NAME
=
1
;
//使用方名,1生活圈,2主端
const
WALLET_ORDER_TYPE_USER
=
601
;
// 钱包-邀请新用户奖励类型
const
WALLET_ORDER_TYPE_ORDER
=
602
;
// 钱包-邀请下单奖励类型
public
$capitalPoolId
=
null
;
public
$capitalPoolId
=
null
;
...
@@ -72,13 +74,14 @@ class ColonelwalletController extends Job
...
@@ -72,13 +74,14 @@ class ColonelwalletController extends Job
$httpParams
=
self
::
getWalletHttpParams
();
$httpParams
=
self
::
getWalletHttpParams
();
$list
=
[];
$list
=
[];
foreach
(
$payInfoList
as
$payInfo
)
{
foreach
(
$payInfoList
as
$payInfo
)
{
$thirdOrderInfo
=
self
::
getThirdOrderInfo
(
$payInfo
);
$list
[]
=
[
$list
[]
=
[
'user_id'
=>
$payInfo
[
'colonel_user_id'
],
'user_id'
=>
$payInfo
[
'colonel_user_id'
],
'service_name'
=>
self
::
WALLET_SERVICE_NAME
,
'service_name'
=>
self
::
WALLET_SERVICE_NAME
,
'source_name'
=>
self
::
WALLET_SOURCE_NAME
,
'source_name'
=>
self
::
WALLET_SOURCE_NAME
,
'third_order_id'
=>
$payInfo
[
'pay_info_trade_id'
],
'third_order_id'
=>
$payInfo
[
'pay_info_trade_id'
],
'third_order_id_type'
=>
$
pay
Info
[
'type'
],
'third_order_id_type'
=>
$
thirdOrder
Info
[
'type'
],
'third_order_desc'
=>
self
::
getThirdOrderDesc
(
$payInfo
)
,
'third_order_desc'
=>
$thirdOrderInfo
[
'desc'
]
,
'amount'
=>
$payInfo
[
'reward'
],
'amount'
=>
$payInfo
[
'reward'
],
'extra'
=>
''
'extra'
=>
''
];
];
...
@@ -90,7 +93,7 @@ class ColonelwalletController extends Job
...
@@ -90,7 +93,7 @@ class ColonelwalletController extends Job
$this
->
loggerInfo
(
'调用钱包服务成功,count='
.
count
(
$payInfoList
));
$this
->
loggerInfo
(
'调用钱包服务成功,count='
.
count
(
$payInfoList
));
return
true
;
return
true
;
}
else
{
}
else
{
throw
new
Exception
(
'调用钱包服务失败,
httpParams='
.
json_encode
(
$httpParams
));
throw
new
Exception
(
'调用钱包服务失败,
'
.
json_encode
([
'req'
=>
$httpParams
,
'res'
=>
$response
]
));
}
}
}
}
...
@@ -113,13 +116,14 @@ class ColonelwalletController extends Job
...
@@ -113,13 +116,14 @@ class ColonelwalletController extends Job
];
];
$body
=
[];
$body
=
[];
foreach
(
$payInfoList
as
$payInfo
)
{
foreach
(
$payInfoList
as
$payInfo
)
{
$thirdOrderInfo
=
self
::
getThirdOrderInfo
(
$payInfo
);
$body
[]
=
[
$body
[]
=
[
'op'
=>
self
::
CAPITAL_POOL_OP
,
'op'
=>
self
::
CAPITAL_POOL_OP
,
'user_id'
=>
$payInfo
[
'colonel_user_id'
],
'user_id'
=>
$payInfo
[
'colonel_user_id'
],
'amount'
=>
$payInfo
[
'reward'
],
'amount'
=>
$payInfo
[
'reward'
],
'third_order_id'
=>
$payInfo
[
'pay_info_trade_id'
],
'third_order_id'
=>
$payInfo
[
'pay_info_trade_id'
],
'third_order_id_type'
=>
$
pay
Info
[
'type'
],
'third_order_id_type'
=>
$
thirdOrder
Info
[
'type'
],
'third_order_desc'
=>
self
::
getThirdOrderDesc
(
$payInfo
)
,
'third_order_desc'
=>
$thirdOrderInfo
[
'desc'
]
,
];
];
}
}
$httpParams
[
'body'
]
=
$body
;
$httpParams
[
'body'
]
=
$body
;
...
@@ -129,7 +133,7 @@ class ColonelwalletController extends Job
...
@@ -129,7 +133,7 @@ class ColonelwalletController extends Job
$this
->
loggerInfo
(
'调用资金池服务成功,count='
.
count
(
$payInfoList
));
$this
->
loggerInfo
(
'调用资金池服务成功,count='
.
count
(
$payInfoList
));
return
true
;
return
true
;
}
else
{
}
else
{
throw
new
Exception
(
'调用资金池服务失败,
httpParams='
.
json_encode
(
$httpParams
)
);
throw
new
Exception
(
'调用资金池服务失败,
'
.
[
'req'
=>
$httpParams
,
'res'
=>
$res
]
);
}
}
}
}
...
@@ -178,17 +182,23 @@ class ColonelwalletController extends Job
...
@@ -178,17 +182,23 @@ class ColonelwalletController extends Job
* User: pengfei@yidian-inc.com
* User: pengfei@yidian-inc.com
* Date: 2021/9/3 6:10 下午
* Date: 2021/9/3 6:10 下午
* @param $payInfo
* @param $payInfo
* @return
string
* @return
array
*/
*/
private
function
getThirdOrder
Desc
(
$payInfo
)
:
string
private
function
getThirdOrder
Info
(
$payInfo
)
:
array
{
{
$
desc
=
''
;
$
info
=
[]
;
if
(
$payInfo
[
'type'
]
==
ColonelDistributorPayInfo
::
TYPE_NEW_USER
)
{
if
(
$payInfo
[
'type'
]
==
ColonelDistributorPayInfo
::
TYPE_NEW_USER
)
{
$desc
=
"邀请新用户("
.
$payInfo
[
"invite_user_nick"
]
.
")完成下单奖励"
;
$info
=
[
'desc'
=>
"邀请新用户("
.
$payInfo
[
"invite_user_nick"
]
.
")完成下单奖励"
,
'type'
=>
self
::
WALLET_ORDER_TYPE_USER
,
];
}
elseif
(
$payInfo
[
'type'
]
==
ColonelDistributorPayInfo
::
TYPE_FINISH_TARGET
)
{
}
elseif
(
$payInfo
[
'type'
]
==
ColonelDistributorPayInfo
::
TYPE_FINISH_TARGET
)
{
$desc
=
"完成"
.
$payInfo
[
"finish_num"
]
.
"单用户下单奖励"
;
$info
=
[
'desc'
=>
"完成"
.
$payInfo
[
"finish_num"
]
.
"单用户下单奖励"
,
'type'
=>
self
::
WALLET_ORDER_TYPE_ORDER
,
];
}
}
return
$
desc
;
return
$
info
;
}
}
...
@@ -207,7 +217,7 @@ class ColonelwalletController extends Job
...
@@ -207,7 +217,7 @@ class ColonelwalletController extends Job
[
'pay_info_id'
=>
$payInfoIds
]
[
'pay_info_id'
=>
$payInfoIds
]
);
);
if
(
empty
(
$upStatus
))
{
if
(
empty
(
$upStatus
))
{
throw
new
Exception
(
'更新pay_info状态失败.pay_info_ids='
.
implode
(
','
,
$payInfoIds
));
throw
new
Exception
(
'更新pay_info状态失败.pay_info_ids='
.
implode
(
','
,
$payInfoIds
));
}
}
return
$upStatus
;
return
$upStatus
;
}
}
...
...
conf/cli.ini
View file @
f46bbfa8
...
@@ -11,7 +11,11 @@ idgen.partner = "bp"
...
@@ -11,7 +11,11 @@ idgen.partner = "bp"
idgen.key
=
"5cfdb867e96374c7883b31d6928cc4cb"
idgen.key
=
"5cfdb867e96374c7883b31d6928cc4cb"
[prod : common]
[prod : common]
colonel.wallet.transfer_service_id
=
"21090614423333205002"
colonel.wallet.transfer_service_secret
=
"4916927cf3305292f5a524db592dfa95"
[perf : common ]
[perf : common ]
colonel.wallet.transfer_service_id
=
"21090614423333205002"
colonel.wallet.transfer_service_secret
=
"4916927cf3305292f5a524db592dfa95"
[test: common ]
[test: common ]
colonel.wallet.transfer_service_id
=
"21090614423333205002"
colonel.wallet.transfer_service_id
=
"21090614423333205002"
colonel.wallet.transfer_service_secret
=
"4916927cf3305292f5a524db592dfa95"
colonel.wallet.transfer_service_secret
=
"4916927cf3305292f5a524db592dfa95"
...
...
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