Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ic_server_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
84ec7bbd
authored
Aug 18, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
针对红包信息部分的后台进行相应的修改
parent
3bdbee7f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
app/Http/Controllers/IntegralBillsController.php
app/Http/Controllers/IntegralsController.php
routes/web.php
storage/laravels.json
storage/laravels.pid
app/Http/Controllers/IntegralBillsController.php
View file @
84ec7bbd
...
...
@@ -30,7 +30,7 @@ class IntegralBillsController extends Controller
{
$res
=
DB
::
table
(
'integral_bills'
)
->
insert
([
'user_id'
=>
$request
->
user_id
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'integral_id'
=>
$request
->
integral_id
,
'status'
=>
1
,
'add_time'
=>
time
(),
...
...
@@ -48,7 +48,7 @@ class IntegralBillsController extends Controller
$res
=
DB
::
table
(
'integral_bills'
)
->
where
(
'id'
,
$id
)
->
update
([
'user_id'
=>
$request
->
user_id
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'integral_id'
=>
$request
->
integral_id
,
'status'
=>
1
,
'update_time'
=>
time
(),
...
...
app/Http/Controllers/IntegralsController.php
View file @
84ec7bbd
...
...
@@ -8,6 +8,7 @@ use App\Http\Filters\IntegralFilter;
use
App\Models\Integral
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
class
IntegralsController
extends
Controller
{
...
...
@@ -38,7 +39,7 @@ class IntegralsController extends Controller
$res
=
DB
::
table
(
'integrals'
)
->
insert
([
'name'
=>
$request
->
name
,
'daily_limit'
=>
$request
->
daily_limit
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'add_time'
=>
time
(),
'status'
=>
$request
->
status
,
]);
...
...
@@ -52,15 +53,26 @@ class IntegralsController extends Controller
public
function
update
(
Request
$request
,
$id
)
{
$data
=
array_merge
(
$request
->
all
(),
[
'update_time'
=>
time
()]);
$res
=
DB
::
table
(
'integrals'
)
->
where
(
'id'
,
$id
)
->
update
([
'name'
=>
$request
->
name
,
'daily_limit'
=>
$request
->
daily_limit
,
'amount'
=>
$request
->
amount
,
'update_time'
=>
time
(),
]);
->
update
(
$data
);
return
$this
->
Export
(
0
,
'ok'
);
}
public
function
batchUpdateStatus
(
Request
$request
)
{
$ids
=
$request
->
ids
;
if
(
!
is_array
(
$ids
))
{
return
Log
::
Info
(
'批量修改参数不是数组'
);
}
$status
=
$request
->
status
;
$result
=
DB
::
table
(
'integrals'
)
->
whereIn
(
'id'
,
$ids
)
->
update
([
'status'
=>
(
int
)
$status
]);
return
$this
->
Export
(
0
,
'ok'
);
// return $this->Export(033, '批量修改用户积分失败');
}
public
function
destroy
(
$ids
)
...
...
routes/web.php
View file @
84ec7bbd
...
...
@@ -25,6 +25,8 @@ $router->get('/integrals/{id}', 'IntegralsController@show');
$router
->
post
(
'/integrals'
,
'IntegralsController@create'
);
$router
->
patch
(
'/integrals/{id}'
,
'IntegralsController@update'
);
$router
->
delete
(
'/integrals/{id}'
,
'IntegralsController@destroy'
);
$router
->
post
(
'/integrals/batchUpdateStatus'
,
'IntegralsController@batchUpdateStatus'
);
//积分类型
$router
->
get
(
'/integral_types'
,
'IntegralTypesController@index'
);
...
...
storage/laravels.json
View file @
84ec7bbd
This diff is collapsed.
Click to expand it.
storage/laravels.pid
View file @
84ec7bbd
17171
\ No newline at end of file
17955
\ 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