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
d37619f6
authored
Aug 27, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加分享获取红包
parent
9e518365
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
app/Http/Controllers/ShareController.php
app/Services/ShareService.php
routes/web.php
app/Http/Controllers/ShareController.php
0 → 100644
View file @
d37619f6
<?php
namespace
App\Http\Controllers
;
use
App\Services\OfferService
;
use
App\Services\ShareService
;
use
Illuminate\Http\Request
;
class
ShareController
extends
Controller
{
private
$service
;
public
function
__construct
(
ShareService
$service
)
{
$this
->
service
=
$service
;
}
//回复报价的类型id
const
INTEGRAL_TYPE_SHARE
=
4
;
public
function
store
(
Request
$request
)
{
$userId
=
$request
->
user
->
user_id
;
$integralId
=
self
::
INTEGRAL_TYPE_SHARE
;
$map
=
[
'user_id'
=>
$userId
,
'integral_id'
=>
$integralId
,
];
$result
=
$this
->
service
->
addShare
(
$map
);
if
(
$result
[
'errcode'
]
===
self
::
SUCCESS
)
{
return
$this
->
Export
(
0
,
'ok'
);
}
else
{
return
$this
->
Export
(
self
::
SHARE_FAIL
);
}
}
}
\ No newline at end of file
app/Services/ShareService.php
0 → 100644
View file @
d37619f6
<?php
namespace
App\Services
;
class
ShareService
{
//回复报价需要添加流水
public
function
addShare
(
$map
=
[])
{
$url
=
config
(
'website.BaseUrl'
)
.
'/integral_bills/add'
;
$result
=
reportCurl
(
$url
,
$map
,
true
);
$result
=
json_decode
(
$result
,
true
);
return
$result
;
}
}
\ No newline at end of file
routes/web.php
View file @
d37619f6
...
...
@@ -47,6 +47,13 @@ $router->group(['middleware' => ['web', 'login']], function () use ($router) {
//用户兑换接口
$router
->
post
(
'user_exchanges/exchange'
,
'UserExchangesController@exchange'
);
//每日分享
$router
->
post
(
'share/add'
,
'ShareController@store'
);
//邀请好友
$router
->
post
(
'invites/add'
,
'InvitesController@store'
);
});
$router
->
group
([
'middleware'
=>
'web'
],
function
()
use
(
$router
)
{
$router
->
post
(
'/oss/upload'
,
'OssController@upload'
);
...
...
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