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
3f95449b
authored
Oct 16, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev'
parents
344594b9
aa8cc637
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
107 additions
and
58 deletions
app/Console/Commands/CreateNotice.php
app/Logic/SystemNoticeLogic.php
app/Model/SystemUpdateModel.php
config/msgconfig.php
public/.htaccess
public/js/Message/getNotice.js
public/js/Message/systemUpdate.js
resources/views/message/systemBulletin.blade.php
resources/views/message/systemUpdate.blade.php
app/Console/Commands/CreateNotice.php
View file @
3f95449b
...
...
@@ -42,6 +42,7 @@ class CreateNotice extends Command
*/
public
function
handle
()
{
return
1
;
//查找出今日的所有更新
$date
=
date
(
'Y-m-d'
);
...
...
app/Logic/SystemNoticeLogic.php
View file @
3f95449b
...
...
@@ -340,10 +340,11 @@ class SystemNoticeLogic
public
function
createNotice
(
$requestData
)
{
//查找出今日的所有更新
$date
=
$requestData
[
'date'
]
;
$date
=
date
(
'Y-m-d'
)
;
$where
[
'begin_time'
]
=
$date
;
$where
[
'end_time'
]
=
date
(
'Y-m-d H:i:s'
,
strtotime
(
$date
)
+
86400
);
// $where['begin_time'] = $date;
// $where['end_time'] = date('Y-m-d H:i:s',strtotime($date)+86400);
$where
[
'smue_id_str'
]
=
$requestData
[
'smue_id_str'
];
$systemUpdateModel
=
new
SystemUpdateModel
();
...
...
@@ -351,17 +352,23 @@ class SystemNoticeLogic
//韦伯系统是所有的,通知所有人
$allUpdate
=
$systemUpdateModel
->
getWhereObj
(
$where
)
->
get
()
->
toArray
();
if
(
!
empty
(
$allUpdate
)){
// 查找所有通知用户邮箱和ID
$sendUser
=
DB
::
table
(
't_user_perm'
)
->
where
(
'begDate'
,
'<='
,
$date
)
->
where
(
'endDate'
,
'>='
,
$date
)
->
select
(
'username'
,
'userId'
)
->
get
();
$createNotice
->
createNoticeSaveData
(
$allUpdate
,
$date
,
'韦伯系统'
,
json_encode
(
$sendUser
));
}
//查找所有需要更新的子系统,通知对应系统的人
$allGroup
=
$systemUpdateModel
->
getWhereObj
(
$where
)
->
groupBy
(
'system_id'
)
->
get
()
->
toArray
();
foreach
(
$allGroup
as
$value
){
// 查找所有通知ID
...
...
@@ -372,7 +379,11 @@ class SystemNoticeLogic
$allUpdate
=
$systemUpdateModel
->
getWhereObj
(
$where
)
->
where
(
'system_id'
,
$value
[
'system_id'
])
->
get
()
->
toArray
();
$createNotice
->
createNoticeSaveData
(
$allUpdate
,
$date
,
$value
[
'system_name'
],
json_encode
(
$sendUser
));
if
(
!
empty
(
$sendUser
)){
$createNotice
->
createNoticeSaveData
(
$allUpdate
,
$date
,
$value
[
'system_name'
],
json_encode
(
$sendUser
));
}
}
}
...
...
app/Model/SystemUpdateModel.php
View file @
3f95449b
...
...
@@ -30,6 +30,9 @@ class SystemUpdateModel extends Model
case
'version_num'
:
case
'weonlt_id'
:
$obj
=
$obj
->
where
(
$key
,
$val
);
break
;
case
'smue_id_str'
:
$obj
=
$obj
->
whereIn
(
'smue_id'
,
explode
(
','
,
$val
));
break
;
case
'update_title'
:
case
'update_content'
:
$obj
=
$obj
->
where
(
$key
,
'like'
,
'%'
.
$val
.
'%'
);
break
;
...
...
config/msgconfig.php
View file @
3f95449b
...
...
@@ -9,7 +9,7 @@
return
[
//域名
'domain_local'
=>
'message.liexin.net'
,
'domain_local'
=>
'message.liexin
dev
.net'
,
'domain_sz'
=>
'szmessage.ichunt.net'
,
'domain_release'
=>
'message.ichunt.net'
,
...
...
public/.htaccess
View file @
3f95449b
<
IfModule
mod_rewrite.c
>
<
IfModule
mod_negotiation.c
>
Options
-MultiViews
</
IfModule
>
RewriteEngine
On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteRule
^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteRule
^ index.php [L]
</
IfModule
>
<
IfModule
deflate_module
>
# 对js,html,xml,css,普通文本开启Gzip压缩
AddOutputFilterByType
DEFLATE application/x-javascript text/html text/plain text/xml text/css
</
IfModule
>
public/js/Message/getNotice.js
View file @
3f95449b
...
...
@@ -17,7 +17,7 @@ layui.use(['layer'], function(){
if
(
host
.
indexOf
(
'ichunt.net'
)
!=
-
1
)
{
requestUrl
=
'http://message.ichunt.net/notice/getNotice'
}
else
{
requestUrl
=
'http://message.liexin.net/notice/getNotice'
requestUrl
=
'http://message.liexin
dev
.net/notice/getNotice'
}
$
.
ajax
({
...
...
public/js/Message/systemUpdate.js
View file @
3f95449b
...
...
@@ -25,32 +25,29 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate','laye
form
.
render
();
//数据表格渲染
var
dataList
=
function
(){
table
.
render
({
elem
:
'#systemUpdateList'
,
url
:
'/msgapi/systemUpdateList'
,
page
:
true
,
limit
:
20
,
id
:
'table'
,
cols
:
[[
//表头
{
field
:
'smue_id'
,
title
:
'序号'
,
align
:
'center'
,
width
:
100
},
{
field
:
'update_time'
,
title
:
'更新日期'
,
align
:
'center'
,
width
:
150
},
{
field
:
'system_name'
,
title
:
'更新系统'
,
align
:
'center'
,
width
:
150
},
{
field
:
'version_num'
,
title
:
'版本号'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_type'
,
title
:
'更新类型'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_title'
,
title
:
'更新标题'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_content'
,
title
:
'更新内容'
,
align
:
'center'
,
width
:
150
},
{
field
:
'product_user'
,
title
:
'产品负责人'
,
align
:
'center'
,
width
:
150
},
{
field
:
'code_user'
,
title
:
'技术负责人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'test_user'
,
title
:
'测试负责人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'bulletin_count'
,
title
:
'公告发送次数'
,
align
:
'center'
,
width
:
180
},
{
field
:
'email_count'
,
title
:
'邮件发送次数'
,
align
:
'center'
,
width
:
180
},
{
field
:
'active'
,
toolbar
:
'#active'
,
title
:
'操作'
,
align
:
'center'
,
width
:
150
,
fixed
:
'right'
}
]]
});
};
var
dataList
=
table
.
render
({
elem
:
'#systemUpdateList'
,
url
:
'/msgapi/systemUpdateList'
,
page
:
true
,
limit
:
20
,
cols
:
[[
//表头
{
type
:
'checkbox'
,
width
:
50
,
align
:
'center'
,
fixed
:
'left'
},
{
field
:
'smue_id'
,
title
:
'序号'
,
align
:
'center'
,
width
:
100
},
{
field
:
'update_time'
,
title
:
'更新日期'
,
align
:
'center'
,
width
:
150
},
{
field
:
'system_name'
,
title
:
'更新系统'
,
align
:
'center'
,
width
:
150
},
{
field
:
'version_num'
,
title
:
'版本号'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_type'
,
title
:
'更新类型'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_title'
,
title
:
'更新标题'
,
align
:
'center'
,
width
:
150
},
{
field
:
'update_content'
,
title
:
'更新内容'
,
align
:
'center'
,
width
:
150
},
{
field
:
'product_user'
,
title
:
'产品负责人'
,
align
:
'center'
,
width
:
150
},
{
field
:
'code_user'
,
title
:
'技术负责人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'test_user'
,
title
:
'测试负责人'
,
align
:
'center'
,
width
:
180
},
{
field
:
'bulletin_count'
,
title
:
'公告发送次数'
,
align
:
'center'
,
width
:
180
},
{
field
:
'email_count'
,
title
:
'邮件发送次数'
,
align
:
'center'
,
width
:
180
},
{
field
:
'active'
,
toolbar
:
'#active'
,
title
:
'操作'
,
align
:
'center'
,
width
:
150
,
fixed
:
'right'
}
]]
});
dataList
();
form
.
on
(
'submit(load)'
,
function
(
data
)
{
...
...
@@ -67,6 +64,48 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate','laye
});
// 点击按钮获取选中值
$
(
'#createSelectNotice'
).
on
(
'click'
,
function
(){
// 获取选中数据
var
checkStatus
=
table
.
checkStatus
(
'systemUpdateList'
);
if
(
checkStatus
.
data
.
length
==
0
){
alert
(
'请先选择数据'
);
return
false
;
}
// 输出选中的数据
console
.
log
(
'选中的数据:'
,
checkStatus
.
data
);
// 提取选中的ID(实际应用中常用)
var
ids
=
checkStatus
.
data
.
map
(
function
(
item
){
return
item
.
smue_id
;
});
$
.
ajax
({
url
:
'/msgapi/createNotice'
,
type
:
'post'
,
data
:
{
'smue_id_str'
:
ids
.
join
(
','
)},
dataType
:
'json'
,
success
:
function
(
resp
)
{
if
(
resp
.
code
==
0
)
{
layer
.
msg
(
resp
.
msg
);
window
.
location
.
reload
();
return
false
;
}
layer
.
msg
(
resp
.
msg
);
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
});
});
form
.
on
(
'select(system_id)'
,
function
(
data
)
{
$
.
ajax
({
...
...
@@ -224,5 +263,7 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate','laye
});
resources/views/message/systemBulletin.blade.php
View file @
3f95449b
...
...
@@ -19,12 +19,12 @@
<input
type=
"text"
class=
"layui-input"
id=
"notice_date"
name=
"notice_date"
>
</div>
</div>
<div
class=
"layui-inline "
>
<label
class=
"layui-form-label"
></label>
<div
class=
"layui-input-inline"
>
<button
class=
"layui-btn-sm layui-btn-warm"
id=
"createNotice"
>
生成公告
</button>
</div>
</div>
{{--
<div
class=
"layui-inline "
>
--}}
{{--
<label
class=
"layui-form-label"
></label>
--}}
{{--
<div
class=
"layui-input-inline"
>
--}}
{{--
<button
class=
"layui-btn-sm layui-btn-warm"
id=
"createNotice"
>
生成公告
</button>
--}}
{{--
</div>
--}}
{{--
</div>
--}}
</div>
<form
class=
"layui-form layui-box"
method=
"post"
>
...
...
resources/views/message/systemUpdate.blade.php
View file @
3f95449b
...
...
@@ -73,6 +73,19 @@
</div>
</div>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
产品负责人
</label>
<div
class=
"layui-input-inline"
>
<select
name=
"product_user"
lay-search
lay-verify=
"required"
>
<option
value=
""
></option>
@foreach($user as $key=>$value)
<option
value=
"{{$key}}"
>
{{$value}}
</option>
@endforeach
</select>
</div>
</div>
</div>
...
...
@@ -80,6 +93,7 @@
<div
class=
"layui-btn-container"
style=
"text-align: center; margin-top: 10px;"
>
<button
lay-submit
lay-filter=
"load"
class=
"layui-btn"
>
搜索
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addData"
>
新增
</button>
<a
class=
"layui-btn layui-btn-sm layui-btn-warm"
id=
"createSelectNotice"
href=
"javascript:;"
>
生成公告
</a>
</div>
</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