Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
62bc088e
Commit
62bc088e
authored
Sep 29, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改模糊查询分页bug
parent
bb2bfb71
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
59 deletions
+43
-59
SMSController.php
app/Http/Controllers/SMSController.php
+14
-0
UserController.php
app/Http/Controllers/UserController.php
+5
-4
SMS.php
app/Models/SMS.php
+10
-0
AppServiceProvider.php
app/Providers/AppServiceProvider.php
+2
-1
UserService.php
app/Services/UserService.php
+7
-14
2014_10_12_100000_create_password_resets_table.php
...ations/2014_10_12_100000_create_password_resets_table.php
+0
-32
2017_09_29_153241_create_sms_table.php
database/migrations/2017_09_29_153241_create_sms_table.php
+4
-7
usertables.blade.php
resources/views/admin/usertables.blade.php
+1
-1
No files found.
app/Http/Controllers/SMSController.php
View file @
62bc088e
...
...
@@ -2,7 +2,10 @@
namespace
App\Http\Controllers
;
use
App\Models\SMS
;
use
Carbon\Carbon
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\DB
;
class
SMSController
extends
Controller
{
...
...
@@ -10,6 +13,17 @@ class SMSController extends Controller
public
function
surplus
()
{
$sid
=
SMS
::
max
(
'id'
);
$sms
=
SMS
::
find
(
$sid
);
if
(
$sms
->
created_at
->
isToday
()){
}
else
{
echo
"插入记录"
;
}
dd
(
"aa"
);
$account
=
env
(
'FEIGE_ACCOUNT'
);
$pwd
=
env
(
'FEIGE_PWD'
);
...
...
app/Http/Controllers/UserController.php
View file @
62bc088e
...
...
@@ -100,13 +100,14 @@ class UserController extends Controller
public
function
simpleSearch
(
Request
$request
)
{
$search_content
=
$request
->
search
;
if
(
$request
->
search
==
null
){
return
Message
::
makeError
(
'没有参数'
);
}
$search_content
=
$request
->
search
;
$page
=
1
;
$result
=
$this
->
mUser
->
simpleSearch
(
$search_content
,
$page
);
return
view
(
'admin/usertables'
,
compact
(
'result'
));
return
view
(
'admin/usertables'
,[
'result'
=>
$result
,
'params'
=>
$search_content
]);
}
}
app/Models/SMS.php
0 → 100644
View file @
62bc088e
<?php
namespace
App\Models
;
use
Illuminate\Database\Eloquent\Model
;
class
SMS
extends
Model
{
protected
$table
=
'sms'
;
}
app/Providers/AppServiceProvider.php
View file @
62bc088e
...
...
@@ -2,6 +2,7 @@
namespace
App\Providers
;
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Support\ServiceProvider
;
class
AppServiceProvider
extends
ServiceProvider
...
...
@@ -13,7 +14,7 @@ class AppServiceProvider extends ServiceProvider
*/
public
function
boot
()
{
//
Schema
::
defaultStringLength
(
191
);
}
/**
...
...
app/Services/UserService.php
View file @
62bc088e
...
...
@@ -20,21 +20,14 @@ class UserService implements UserServiceContract
public
function
simpleSearch
(
$search_content
,
$page
)
{
$user_name
=
User
::
where
(
'user_name'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
paginate
(
$page
);
$phone
=
User
::
where
(
'phone'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
paginate
(
$page
);
$email
=
User
::
where
(
'email'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
paginate
(
$page
);
$users
=
User
::
where
(
'user_name'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
orWhere
(
'phone'
,
'like'
,
'%'
.
$search_content
.
'%'
)
->
orWhere
(
'email'
,
'like'
,
'%'
.
$search_content
.
'%'
)
// ->get();
->
paginate
(
$page
);
if
(
count
(
$user_name
)
>
0
){
return
$user_name
;
}
if
(
count
(
$phone
)
>
0
){
return
$phone
;
}
if
(
count
(
$email
)
>
0
){
return
$email
;
}
$result
=
null
;
return
$result
;
return
$users
;
}
...
...
database/migrations/2014_10_12_100000_create_password_resets_table.php
deleted
100644 → 0
View file @
bb2bfb71
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
CreatePasswordResetsTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'password_resets'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'email'
)
->
index
();
$table
->
string
(
'token'
);
$table
->
timestamp
(
'created_at'
)
->
nullable
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'password_resets'
);
}
}
database/migrations/201
4_10_12_000000_create_user
s_table.php
→
database/migrations/201
7_09_29_153241_create_sm
s_table.php
View file @
62bc088e
...
...
@@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
class
Create
Users
Table
extends
Migration
class
Create
SMS
Table
extends
Migration
{
/**
* Run the migrations.
...
...
@@ -13,12 +13,9 @@ class CreateUsersTable extends Migration
*/
public
function
up
()
{
Schema
::
create
(
'
user
s'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'
sm
s'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'name'
);
$table
->
string
(
'email'
)
->
unique
();
$table
->
string
(
'password'
);
$table
->
rememberToken
();
$table
->
unsignedInteger
(
'sms_surplus'
);
$table
->
timestamps
();
});
}
...
...
@@ -30,6 +27,6 @@ class CreateUsersTable extends Migration
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'
user
s'
);
Schema
::
dropIfExists
(
'
s_m_
s'
);
}
}
resources/views/admin/usertables.blade.php
View file @
62bc088e
...
...
@@ -83,7 +83,7 @@
@
endforeach
</
table
>
{{
$result
->
links
()
}}
{{
$result
->
appends
([
'search'
=>
$params
])
->
links
()
}}
</
div
>
<!--
/.
box
-
body
-->
</
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