Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_welfare
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
83ce91a8
authored
Aug 21, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
用户红包兑换账单的详情改成统计而不是直接取数据库
parent
e5c586ed
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
9 deletions
app/Http/Controllers/IntegralBillsController.php
app/Http/Services/BaseService.php
app/Http/Services/UserIntegralService.php
public/js/web/userIntegralList.js
resources/views/web/index.blade.php
resources/views/web/integralBillList.blade.php
app/Http/Controllers/IntegralBillsController.php
View file @
83ce91a8
...
...
@@ -38,10 +38,10 @@ class IntegralBillsController extends Controller
{
$this
->
data
[
'title'
]
=
'红包详细'
;
//获取该用户的红包信息
//获取该用户的红包
统计
信息
$userIntegralService
=
new
UserIntegralService
();
$
userIntegral
=
$userIntegralService
->
getUserIntegral
(
$request
->
user_id
);
$this
->
data
[
'
user_integral'
]
=
array_get
(
$userIntegral
,
'data'
)
;
$
statistics
=
$userIntegralService
->
getUserIntegralStatistics
(
$request
->
user_id
);
$this
->
data
[
'
statistics'
]
=
$statistics
;
$integralService
=
new
IntegralService
();
//获取红包列表做tab项
...
...
app/Http/Services/BaseService.php
View file @
83ce91a8
...
...
@@ -35,7 +35,6 @@ class BaseService
public
function
apiDelete
(
$requestPath
)
{
$response
=
$this
->
client
->
request
(
'DELETE'
,
$requestPath
);
$data
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
if
(
$data
[
'errcode'
]
!==
0
)
{
...
...
@@ -58,6 +57,16 @@ class BaseService
return
$data
;
}
public
function
apiRequest
(
$requestPath
,
$data
=
[])
{
$response
=
$this
->
client
->
request
(
'POST'
,
$requestPath
,
[
'form_params'
=>
$data
]
);
$data
=
json_decode
(
$response
->
getBody
()
->
getContents
(),
true
);
return
$data
;
}
public
function
apiPatch
(
$requestPath
,
$data
=
[])
{
$response
=
$this
->
client
->
request
(
'PATCH'
,
$requestPath
,
...
...
@@ -67,6 +76,7 @@ class BaseService
if
(
$data
[
'errcode'
]
!==
0
)
{
Log
::
Error
(
$requestPath
.
'---'
.
$data
[
'errcode'
]
.
$data
[
'errmsg'
]);
}
dd
(
$data
);
return
$data
;
}
...
...
app/Http/Services/UserIntegralService.php
View file @
83ce91a8
...
...
@@ -8,6 +8,7 @@ use App\Model\RedisModel;
class
UserIntegralService
extends
BaseService
{
//获取单个用户的红包信息
public
function
getUserIntegral
(
$userId
)
{
$path
=
'/user_integrals/info?id='
.
$userId
;
...
...
@@ -15,6 +16,15 @@ class UserIntegralService extends BaseService
return
$this
->
apiPost
(
$path
);
}
//获取单个用户的红包统计信息
public
function
getUserIntegralStatistics
(
$userId
)
{
$path
=
'user_integrals/statistics?user_id='
.
$userId
;
return
$this
->
apiRequest
(
$path
);
}
//获取用户的红包列表信息
public
function
getUserIntegralList
(
$params
)
{
$path
=
'/user_integrals/list?'
.
http_build_query
(
$params
);
...
...
@@ -22,6 +32,11 @@ class UserIntegralService extends BaseService
return
$this
->
apiPost
(
$path
);
}
public
function
updateUserIntegral
(
$path
,
$data
)
{
return
$this
->
apiPost
(
$path
,
$data
);
}
public
function
getUsersFromRedis
(
$userIds
=
[])
{
$redis
=
new
RedisModel
();
...
...
public/js/web/userIntegralList.js
View file @
83ce91a8
...
...
@@ -62,8 +62,7 @@ layui.use(['table', 'form', 'laydate', 'layer'], function () {
{
type
:
'checkbox'
}
,
{
field
:
'id'
,
title
:
'序号'
}
,
{
field
:
'mobile'
,
title
:
'注册手机号'
}
,
{
field
:
'integral'
,
title
:
'账户红包'
}
,
{
field
:
'exchanged_integral'
,
title
:
'累计兑换'
}
,
{
field
:
'integral'
,
title
:
'账户剩余红包'
}
,
{
field
:
'certification_status'
,
title
:
'认证状态'
}
,
{
field
:
'status'
,
title
:
'兑换状态'
,
templet
:
'#status'
}
,
{
field
:
'experience'
,
title
:
'操作'
,
templet
:
'#operate'
,
fixed
:
'right'
}
...
...
resources/views/web/index.blade.php
0 → 100644
View file @
83ce91a8
File mode changed
resources/views/web/integralBillList.blade.php
View file @
83ce91a8
...
...
@@ -8,7 +8,7 @@
用户已得红包
</div>
<div
class=
"layui-card-body layuiadmin-card-list"
>
<p
class=
"layuiadmin-big-font"
>
{{$
user_integral['integral
']}}
</p>
<p
class=
"layuiadmin-big-font"
>
{{$
statistics['total_amount
']}}
</p>
</div>
</div>
</div>
...
...
@@ -19,7 +19,7 @@
已提现红包
</div>
<div
class=
"layui-card-body layuiadmin-card-list"
>
<p
class=
"layuiadmin-big-font"
>
{{$
user_integral['exchanged_integral
']}}
</p>
<p
class=
"layuiadmin-big-font"
>
{{$
statistics['exchanged_amount
']}}
</p>
</div>
</div>
</div>
...
...
@@ -30,7 +30,7 @@
账户剩余红包
</div>
<div
class=
"layui-card-body layuiadmin-card-list"
>
<p
class=
"layuiadmin-big-font"
>
{{$
user_integral['integral']-$user_integral['exchanged_
integral']}}
</p>
<p
class=
"layuiadmin-big-font"
>
{{$
statistics['
integral']}}
</p>
</div>
</div>
</div>
...
...
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