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
46f50add
authored
Aug 29, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去掉兑换接口的type字段
parent
6b8be7da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
app/Http/Controllers/UserExchangesController.php
app/Http/Controllers/UserExchangesController.php
View file @
46f50add
...
...
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
use
App\Http\Transformers\UserExchangeTransformer
;
use
App\Services\UserExchangeService
;
use
Carbon\Carbon
;
use
Common\Model\RedisModel
;
use
Illuminate\Http\Request
;
/**
...
...
@@ -55,16 +57,43 @@ class UserExchangesController extends Controller
{
$exchangeId
=
$request
->
get
(
'exchange_id'
);
//先写死用于测试
//
$exchangeId = 1;
$exchangeId
=
1
;
$userId
=
$request
->
user
->
user_id
;
$type
=
$request
->
get
(
'type'
);
$result
=
$service
->
addUserExchange
([
if
(
empty
(
$exchangeId
)
||
empty
(
$type
))
{
return
$this
->
Export
(
self
::
INVALID_PARAMETER
);
}
$data
=
[
'user_id'
=>
$userId
,
'exchange_id'
=>
$exchangeId
,
]);
];
//如果类型是微信转账,则前提是要两个好友助力完成才能成功
//添加兑换记录并且提现
$result
=
$service
->
addUserExchangeAndQuota
(
$data
);
//这里直接使用服务返回的错误码,对应的错误码在language.php
return
$this
->
Export
(
$result
[
'errcode'
]);
}
/**
* 好友助力接口
* @param Request $request
*/
public
function
assist
(
Request
$request
)
{
$userId
=
$request
->
user
->
user_id
;
}
/**
* 兑换详情接口
*/
public
function
info
(
Request
$request
)
{
$userId
=
$request
->
user
->
user_id
;
$type
=
$request
->
get
(
'type'
);
//根据不同类型找到不同的提现信息
}
}
\ No newline at end of file
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