Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
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
11845dac
authored
Dec 19, 2017
by
李洋
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1、更改时间搜索为区间
parent
b36bbb3a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
22 deletions
app/Http/Controllers/MessageController.php
public/js/Message/allhistorylist.js
public/js/Message/manualhistorylist.js
resources/views/message/allhistorylist.blade.php
resources/views/message/manualhistorylist.blade.php
app/Http/Controllers/MessageController.php
View file @
11845dac
...
...
@@ -261,23 +261,25 @@ class MessageController extends Controller
//搜索条件
$search_desc
=
$request
->
input
(
'search_desc'
);
$search_channel
=
$request
->
input
(
'search_channel'
);
$search_sendtime
=
$request
->
input
(
'search_sendtime'
);
$search_sendtime_start
=
$request
->
input
(
'search_sendtime_start'
);
$search_sendtime_end
=
$request
->
input
(
'search_sendtime_end'
);
$db
=
DB
::
connection
(
'message'
);
//1.首次进页面无搜索条件
if
(
null
==
$search_desc
&&
null
==
$search_channel
&&
null
==
$search_sendtime
)
if
(
null
==
$search_desc
&&
null
==
$search_channel
&&
null
==
$search_sendtime
_start
&&
null
==
$search_sendtime_end
)
{
$info
=
$db
->
table
(
'lie_msg_log'
)
->
groupBy
(
'tpl_id'
)
->
having
(
'source_type'
,
'='
,
2
)
->
get
();
$search_channel
=
0
;
$search_desc
=
''
;
$search_sendtime
=
''
;
$search_sendtime_start
=
''
;
$search_sendtime_end
=
''
;
}
else
//2.有搜索条件
{
//时间为查询选择的当天
if
(
!
empty
(
$search_sendtime
))
if
(
!
empty
(
$search_sendtime
_start
)
&&
!
empty
(
$search_sendtime_end
))
{
$start_time
=
strtotime
(
$search_sendtime
);
$end_time
=
strtotime
(
$search_sendtime
)
+
86400
;
$start_time
=
strtotime
(
$search_sendtime
_start
);
$end_time
=
strtotime
(
$search_sendtime
_end
)
;
}
else
//否则为极限时间
{
$start_time
=
31507200
;
...
...
@@ -339,7 +341,8 @@ class MessageController extends Controller
'msg_channels'
=>
$msg_channels
,
'search_desc'
=>
$search_desc
,
'search_channel'
=>
$search_channel
,
'search_sendtime'
=>
$search_sendtime
,
'search_sendtime_start'
=>
$search_sendtime_start
,
'search_sendtime_end'
=>
$search_sendtime_end
,
'manualhistorylist_check'
=>
$manualhistorylist_check
,
'manualmessage_edit'
=>
$manualmessage_edit
,
...
...
@@ -360,26 +363,28 @@ class MessageController extends Controller
//搜索条件
$search_id
=
$request
->
input
(
'search_id'
);
$search_user
=
$request
->
input
(
'search_user'
);
$search_sendtime
=
$request
->
input
(
'search_sendtime'
);
$search_sendtime_start
=
$request
->
input
(
'search_sendtime_start'
);
$search_sendtime_end
=
$request
->
input
(
'search_sendtime_end'
);
$search_channel
=
$request
->
input
(
'search_channel'
);
$search_status
=
$request
->
input
(
'search_status'
);
$db
=
DB
::
connection
(
'message'
);
if
(
$search_id
==
null
&&
$search_user
==
null
&&
$search_sendtime
==
null
&&
$search_channel
==
null
&&
$search_status
==
null
)
if
(
$search_id
==
null
&&
$search_user
==
null
&&
$search_sendtime
_start
==
null
&&
$search_sendtime_end
==
null
&&
$search_channel
==
null
&&
$search_status
==
null
)
{
$info
=
$db
->
table
(
'lie_msg_log'
)
->
paginate
(
20
);
$search_id
=
''
;
$search_user
=
''
;
$search_sendtime
=
''
;
$search_sendtime_start
=
''
;
$search_sendtime_end
=
''
;
$search_channel
=
0
;
$search_status
=
0
;
}
else
{
//时间为查询选择的当天
if
(
!
empty
(
$search_sendtime
))
if
(
!
empty
(
$search_sendtime
_start
)
&&
!
empty
(
$search_sendtime_end
))
{
$start_time
=
strtotime
(
$search_sendtime
);
$end_time
=
strtotime
(
$search_sendtime
)
+
86400
;
$start_time
=
strtotime
(
$search_sendtime
_start
);
$end_time
=
strtotime
(
$search_sendtime
_end
)
;
}
else
//否则为极限时间
{
$start_time
=
31507200
;
...
...
@@ -428,7 +433,8 @@ class MessageController extends Controller
'msg_channels'
=>
$msg_channels
,
'search_id'
=>
$search_id
,
'search_user'
=>
$search_user
,
'search_sendtime'
=>
$search_sendtime
,
'search_sendtime_start'
=>
$search_sendtime_start
,
'search_sendtime_end'
=>
$search_sendtime_end
,
'search_channel'
=>
$search_channel
,
'search_status'
=>
$search_status
,
...
...
public/js/Message/allhistorylist.js
View file @
11845dac
...
...
@@ -5,8 +5,18 @@ layui.use('laydate', function(){
//执行一个laydate实例
laydate
.
render
({
elem
:
'#Choice_start'
,
//指定元素
type
:
'datetime'
,
format
:
'yyyy-MM-dd HH:mm'
// type:'datetime',
// format:'yyyy-MM-dd HH:mm'
});
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#Choice_end'
,
//指定元素
// type:'datetime',
// format:'yyyy-MM-dd HH:mm'
});
});
...
...
@@ -14,8 +24,9 @@ layui.use('laydate', function(){
$
(
'#search-btn'
).
click
(
function
()
{
var
search_id
=
$
(
'#search-msg-id'
).
val
();
var
search_user
=
$
(
'#search-msg-userobj'
).
val
();
var
search_sendtime
=
$
(
'#Choice_start'
).
val
();
var
search_sendtime_start
=
$
(
'#Choice_start'
).
val
();
var
search_sendtime_end
=
$
(
'#Choice_end'
).
val
();
var
search_channel
=
$
(
'#search-msg-channel option:selected'
).
val
();
var
search_status
=
$
(
'#search-msg-status option:selected'
).
val
();
window
.
location
.
href
=
"/message/allhistorylist?search_id="
+
search_id
+
"&search_user="
+
search_user
+
"&search_sendtime
="
+
search_sendtime
+
"&search_channel="
+
search_channel
+
"&search_status="
+
search_status
;
window
.
location
.
href
=
"/message/allhistorylist?search_id="
+
search_id
+
"&search_user="
+
search_user
+
"&search_sendtime
_start="
+
search_sendtime_start
+
"&search_sendtime_end="
+
search_sendtime_end
+
"&search_channel="
+
search_channel
+
"&search_status="
+
search_status
;
})
\ No newline at end of file
public/js/Message/manualhistorylist.js
View file @
11845dac
...
...
@@ -9,11 +9,22 @@ layui.use('laydate', function(){
// format:'yyyy-MM-dd HH-mm'
});
});
layui
.
use
(
'laydate'
,
function
(){
var
laydate
=
layui
.
laydate
;
//执行一个laydate实例
laydate
.
render
({
elem
:
'#Choice_end'
,
//指定元素
// type:'datetime',
// format:'yyyy-MM-dd HH-mm'
});
});
//指定条件搜索
$
(
'#search-btn'
).
click
(
function
()
{
var
search_desc
=
$
(
'#search-desc'
).
val
();
var
search_channel
=
$
(
'#choose-tpl option:selected'
).
val
();
var
search_sendtime
=
$
(
'#Choice_start'
).
val
();
window
.
location
.
href
=
"/message/manualhistorylist?search_desc="
+
search_desc
+
"&search_channel="
+
search_channel
+
"&search_sendtime="
+
search_sendtime
;
var
search_sendtime_start
=
$
(
'#Choice_start'
).
val
();
var
search_sendtime_end
=
$
(
'#Choice_end'
).
val
();
window
.
location
.
href
=
"/message/manualhistorylist?search_desc="
+
search_desc
+
"&search_channel="
+
search_channel
+
"&search_sendtime_start="
+
search_sendtime_start
+
"&search_sendtime_end="
+
search_sendtime_end
;
})
\ No newline at end of file
resources/views/message/allhistorylist.blade.php
View file @
11845dac
...
...
@@ -43,7 +43,8 @@
<input
class=
"form-control"
type=
"text"
id=
"search-msg-userobj"
placeholder=
"请输入用户"
value=
"{{ $search_user }}"
>
<label>
发送时间:
</label>
<input
type=
"text"
class=
"form-control"
id=
"Choice_start"
name=
"create_time_start/condition"
value=
"{{ $search_sendtime }}"
/>
<input
type=
"text"
class=
"form-control"
id=
"Choice_start"
name=
"create_time_start/condition"
value=
"{{ $search_sendtime_start }}"
/>
-
<input
type=
"text"
class=
"form-control"
id=
"Choice_end"
name=
"create_time_end/condition"
value=
"{{ $search_sendtime_end }}"
/>
</div>
<div
class=
"div-b"
style=
"text-align: center"
>
...
...
resources/views/message/manualhistorylist.blade.php
View file @
11845dac
...
...
@@ -35,7 +35,8 @@
@endfor
</select>
<label>
发送时间:
</label>
<input
type=
"text"
class=
"form-control"
id=
"Choice_start"
name=
"create_time_start/condition"
value=
"{{ $search_sendtime }}"
/>
<input
type=
"text"
class=
"form-control"
id=
"Choice_start"
name=
"create_time_start/condition"
value=
"{{ $search_sendtime_start }}"
/>
-
<input
type=
"text"
class=
"form-control"
id=
"Choice_end"
name=
"create_time_end/condition"
value=
"{{ $search_sendtime_end }}"
/>
<input
class=
"btn btn-primary btn-sm"
id=
"search-btn"
style=
"float: right; margin-right: 60px"
value=
"搜索"
/>
</div>
</form>
...
...
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