Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_welfare_api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d1c93db5
authored
Sep 10, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加更多的助力信息
parent
959dd79b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
app/Http/Controllers/AssistsController.php
app/Http/Controllers/Controller.php
config/language.php
app/Http/Controllers/AssistsController.php
View file @
d1c93db5
...
...
@@ -48,10 +48,12 @@ class AssistsController extends Controller
$userExchangeService
=
new
UserExchangeService
();
$userExchange
=
array_get
(
$userExchangeService
->
getUserExchange
([
'id'
=>
$exchangeId
]),
'data'
);
$result
[
'data'
][
'amount'
]
=
array_get
(
$userExchange
,
'amount'
,
'0'
);
$user
=
$this
->
service
->
getUserInfo
(
$userId
);
$temp
=
array_get
(
$userExchange
,
'user_id'
);
$user
=
$this
->
service
->
getUserInfo
(
$temp
);
$result
[
'data'
][
'user_info'
]
=
[
'avatar'
=>
array_get
(
$user
,
'avatar'
),
'company_name'
=>
array_get
(
$user
,
'company_name'
,
''
),
'user_id'
=>
array_get
(
$user
,
'user_id'
,
''
),
];
$needAssistCount
=
2
;
$result
[
'data'
][
'need_assist_count'
]
=
$needAssistCount
-
count
(
$list
);
...
...
@@ -74,6 +76,10 @@ class AssistsController extends Controller
$result
=
$this
->
service
->
addAssist
(
$map
);
if
(
$result
[
'errcode'
]
===
self
::
SUCCESS
)
{
return
$this
->
Export
(
0
,
'ok'
);
}
elseif
(
$result
[
'errcode'
]
===
109008
)
{
return
$this
->
Export
(
self
::
CAN_NOT_ASSIST_MYSELF
);
}
elseif
(
$result
[
'errcode'
]
===
109009
)
{
return
$this
->
Export
(
self
::
CAN_NOT_ASSIST
);
}
else
{
return
$this
->
Export
(
self
::
ASSIST_FAIL
);
}
...
...
app/Http/Controllers/Controller.php
View file @
d1c93db5
...
...
@@ -19,8 +19,14 @@ class Controller extends BaseController
const
INVALID_CODE
=
109006
;
//已经兑换过红包码,不能再兑换
const
EXCHANGED_CODE
=
109007
;
//自己不能助力自己
const
CAN_NOT_ASSIST_MYSELF
=
109008
;
//不能助力了(助力人数已满或者用户已经助力过)
const
CAN_NOT_ASSIST
=
109009
;
const
EXCHANGED_TODAY
=
109100
;
//这个是服务那边返回的错误码,代表已经超出了每日每人可领取的对应项的数额(比如每人每天只能签到一次)
const
INTEGRAL_LIMIT
=
509000
;
...
...
config/language.php
View file @
d1c93db5
...
...
@@ -15,6 +15,8 @@ return [
109005
=>
'用户无法兑换,用户未认证'
,
109006
=>
'红包码无效'
,
109007
=>
'已经兑换过红包码,不能再兑换'
,
109008
=>
'自己不能助力自己'
,
109009
=>
'助力人数已满或者您已经助力过'
,
109100
=>
'今天已经兑换过了,请明天再来吧'
,
109101
=>
'兑换名额被抢光了'
,
...
...
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