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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
23 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
...
@@ -29,11 +29,11 @@ class IntegralBillsController extends Controller
...
@@ -29,11 +29,11 @@ class IntegralBillsController extends Controller
public
function
create
(
Request
$request
)
public
function
create
(
Request
$request
)
{
{
$res
=
DB
::
table
(
'integral_bills'
)
->
insert
([
$res
=
DB
::
table
(
'integral_bills'
)
->
insert
([
'user_id'
=>
$request
->
user_id
,
'user_id'
=>
$request
->
user_id
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'integral_id'
=>
$request
->
integral_id
,
'integral_id'
=>
$request
->
integral_id
,
'status'
=>
1
,
'status'
=>
1
,
'add_time'
=>
time
(),
'add_time'
=>
time
(),
]);
]);
if
(
$res
)
{
if
(
$res
)
{
...
@@ -47,11 +47,11 @@ class IntegralBillsController extends Controller
...
@@ -47,11 +47,11 @@ class IntegralBillsController extends Controller
{
{
$res
=
DB
::
table
(
'integral_bills'
)
->
where
(
'id'
,
$id
)
$res
=
DB
::
table
(
'integral_bills'
)
->
where
(
'id'
,
$id
)
->
update
([
->
update
([
'user_id'
=>
$request
->
user_id
,
'user_id'
=>
$request
->
user_id
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'integral_id'
=>
$request
->
integral_id
,
'integral_id'
=>
$request
->
integral_id
,
'status'
=>
1
,
'status'
=>
1
,
'update_time'
=>
time
(),
'update_time'
=>
time
(),
]);
]);
if
(
$res
)
{
if
(
$res
)
{
return
$this
->
Export
(
0
,
'ok'
);
return
$this
->
Export
(
0
,
'ok'
);
...
...
app/Http/Controllers/IntegralsController.php
View file @
84ec7bbd
...
@@ -8,6 +8,7 @@ use App\Http\Filters\IntegralFilter;
...
@@ -8,6 +8,7 @@ use App\Http\Filters\IntegralFilter;
use
App\Models\Integral
;
use
App\Models\Integral
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Log
;
class
IntegralsController
extends
Controller
class
IntegralsController
extends
Controller
{
{
...
@@ -36,11 +37,11 @@ class IntegralsController extends Controller
...
@@ -36,11 +37,11 @@ class IntegralsController extends Controller
public
function
create
(
Request
$request
)
public
function
create
(
Request
$request
)
{
{
$res
=
DB
::
table
(
'integrals'
)
->
insert
([
$res
=
DB
::
table
(
'integrals'
)
->
insert
([
'name'
=>
$request
->
name
,
'name'
=>
$request
->
name
,
'daily_limit'
=>
$request
->
daily_limit
,
'daily_limit'
=>
$request
->
daily_limit
,
'
integral_amount'
=>
$request
->
integral_
amount
,
'
amount'
=>
$request
->
amount
,
'add_time'
=>
time
(),
'add_time'
=>
time
(),
'status'
=>
$request
->
status
,
'status'
=>
$request
->
status
,
]);
]);
if
(
$res
)
{
if
(
$res
)
{
...
@@ -52,17 +53,28 @@ class IntegralsController extends Controller
...
@@ -52,17 +53,28 @@ class IntegralsController extends Controller
public
function
update
(
Request
$request
,
$id
)
public
function
update
(
Request
$request
,
$id
)
{
{
$data
=
array_merge
(
$request
->
all
(),
[
'update_time'
=>
time
()]);
$res
=
DB
::
table
(
'integrals'
)
->
where
(
'id'
,
$id
)
$res
=
DB
::
table
(
'integrals'
)
->
where
(
'id'
,
$id
)
->
update
([
->
update
(
$data
);
'name'
=>
$request
->
name
,
'daily_limit'
=>
$request
->
daily_limit
,
'amount'
=>
$request
->
amount
,
'update_time'
=>
time
(),
]);
return
$this
->
Export
(
0
,
'ok'
);
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
)
public
function
destroy
(
$ids
)
{
{
$ids
=
explode
(
','
,
trim
(
$ids
));
$ids
=
explode
(
','
,
trim
(
$ids
));
...
...
routes/web.php
View file @
84ec7bbd
...
@@ -25,6 +25,8 @@ $router->get('/integrals/{id}', 'IntegralsController@show');
...
@@ -25,6 +25,8 @@ $router->get('/integrals/{id}', 'IntegralsController@show');
$router
->
post
(
'/integrals'
,
'IntegralsController@create'
);
$router
->
post
(
'/integrals'
,
'IntegralsController@create'
);
$router
->
patch
(
'/integrals/{id}'
,
'IntegralsController@update'
);
$router
->
patch
(
'/integrals/{id}'
,
'IntegralsController@update'
);
$router
->
delete
(
'/integrals/{id}'
,
'IntegralsController@destroy'
);
$router
->
delete
(
'/integrals/{id}'
,
'IntegralsController@destroy'
);
$router
->
post
(
'/integrals/batchUpdateStatus'
,
'IntegralsController@batchUpdateStatus'
);
//积分类型
//积分类型
$router
->
get
(
'/integral_types'
,
'IntegralTypesController@index'
);
$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
17955
\ No newline at end of file
\ 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