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
e74d197d
authored
Sep 06, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加最大page_size的限制
parent
8a1d4a72
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
44 additions
and
2 deletions
.env
app/Models/Assist.php
app/Models/CheckIn.php
app/Models/Code.php
app/Models/ExchangeSetting.php
app/Models/Integral.php
app/Models/IntegralBill.php
app/Models/Invite.php
app/Models/UserExchange.php
app/Models/UserIntegral.php
routes/web.php
storage/laravels.json
storage/laravels.pid
.env
View file @
e74d197d
...
...
@@ -42,4 +42,6 @@ REDIS_READ_HOST=192.168.1.235
REDIS_READ_PASSWORD=icDb29mLy2s
REDIS_READ_PORT=6379
RobotUrl=https://oapi.dingtalk.com/robot/send?access_token=a7255513c160f20d65c0c00d939fe88712233bbda0dc520563705bf721072d11
app/Models/Assist.php
View file @
e74d197d
...
...
@@ -19,6 +19,8 @@ class Assist extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/CheckIn.php
View file @
e74d197d
...
...
@@ -20,6 +20,8 @@ class CheckIn extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/Code.php
View file @
e74d197d
...
...
@@ -4,6 +4,7 @@
namespace
App\Models
;
use
App\Http\Filters\QueryFilter
;
use
Common\Model\RedisModel
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Support\Facades\DB
;
...
...
@@ -13,6 +14,28 @@ class Code extends Model
{
public
$timestamps
=
false
;
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
public
function
scopeFilter
(
$query
,
QueryFilter
$filters
)
{
return
$filters
->
apply
(
$query
);
}
//获取红包码兑换记录
public
function
getCodeList
(
$page
,
$pageSize
,
$filter
)
{
$codes
=
Code
::
filter
(
$filter
)
->
page
(
$page
,
$pageSize
)
->
orderBy
(
'id'
,
'desc'
)
->
get
()
->
toArray
();
$count
=
Code
::
filter
(
$filter
)
->
count
();
return
[
'data'
=>
$codes
,
'count'
=>
$count
];
}
//判断是否可以输入红包码,因为每个人只能输入一次红包码
public
function
checkCanExchangeCode
(
$data
=
[])
{
...
...
app/Models/ExchangeSetting.php
View file @
e74d197d
...
...
@@ -16,6 +16,8 @@ class ExchangeSetting extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/Integral.php
View file @
e74d197d
...
...
@@ -27,6 +27,8 @@ class Integral extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/IntegralBill.php
View file @
e74d197d
...
...
@@ -25,6 +25,8 @@ class IntegralBill extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/Invite.php
View file @
e74d197d
...
...
@@ -19,6 +19,8 @@ class Invite extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/UserExchange.php
View file @
e74d197d
...
...
@@ -16,6 +16,8 @@ class UserExchange extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
app/Models/UserIntegral.php
View file @
e74d197d
...
...
@@ -14,6 +14,8 @@ class UserIntegral extends Model
public
function
scopePage
(
$query
,
$page
=
1
,
$pageSize
=
10
)
{
$pageSize
=
$pageSize
<
50
?
$pageSize
:
50
;
return
$query
->
offset
((
$page
-
1
)
*
$pageSize
)
->
limit
(
$pageSize
);
}
...
...
routes/web.php
View file @
e74d197d
...
...
@@ -77,6 +77,7 @@ $router->post('/invites/add', 'InvitesController@store');
$router
->
post
(
'/invites/info'
,
'InvitesController@info'
);
//红包码兑换(添加)
$router
->
post
(
'/codes/list'
,
'CodesController@index'
);
$router
->
post
(
'/codes/add'
,
'CodesController@store'
);
//好友助力
...
...
storage/laravels.json
View file @
e74d197d
This diff is collapsed.
Click to expand it.
storage/laravels.pid
View file @
e74d197d
4194
\ No newline at end of file
4199
\ 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