Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
443545ed
Commit
443545ed
authored
Sep 10, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公告
parent
825d21a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
Notice.php
application/index/controller/Notice.php
+11
-6
SFile.php
application/model/SFile.php
+18
-0
No files found.
application/index/controller/Notice.php
View file @
443545ed
...
...
@@ -62,9 +62,12 @@ class Notice extends Basic
$where
[
'a.type'
]
=
1
;
$data
[
'list'
]
=
$this
->
m_push
->
getListAgent
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$m_file
=
new
SFile
();
foreach
(
$data
[
'list'
]
as
$k
=>
$v
){
//dump($v);
$data
[
'list'
][
$k
][
'annex_file_path'
]
=
CURRENT_URL
.
'static/business_school_file/'
.
$v
[
'annex_file_name'
];;
$file_data
=
$m_file
->
getFileList
(
'id,file_name'
,
[
'new_id'
=>
$v
[
'id'
],
'type'
=>
1
]);
foreach
(
$file_data
as
$k2
=>
$v2
)
{
$data
[
'list'
][
$k
][
'annex_file_path'
][]
=
CURRENT_URL
.
'static/business_school_file/'
.
$v2
[
'annex_file_name'
];;
}
}
$data
[
'total'
]
=
$this
->
m_push
->
getListAgentTotal
(
$where
);
return
$this
->
response
(
200
,
""
,
$data
);
...
...
@@ -93,7 +96,7 @@ class Notice extends Basic
$data
[
'annex_file_name'
]
=
$this
->
params
[
'annex_file_name'
];
$id
=
$this
->
m_push
->
addData
(
$data
);
if
(
$id
<
1
)
{
if
(
$id
>
0
)
{
if
(
$this
->
params
[
'annex_file_name'
])
{
$s_file
=
new
SFile
();
$annex_file_name
=
explode
(
','
,
$this
->
params
[
'annex_file_name'
]);
...
...
@@ -106,13 +109,13 @@ class Notice extends Basic
$s_file
->
insertData
(
$file_data
);
}
}
}
else
{
return
$this
->
response
(
101
,
'新增公告失败!'
);
}
$service_push
=
new
PushMessageService
();
$url
=
'app/dist/index.html#/announcementDetails?id='
.
$
this
->
m_push
->
id
;
$this
->
m_push
->
editData
([
'link'
=>
CURRENT_URL
.
$url
],
$
this
->
m_push
->
id
);
$url
=
'app/dist/index.html#/announcementDetails?id='
.
$id
;
$this
->
m_push
->
editData
([
'link'
=>
CURRENT_URL
.
$url
],
$id
);
$service_push
->
pushAll
(
$data
[
'title'
],
'点击查看公告内容'
,
$url
);
return
$this
->
response
(
200
,
'新增成功!'
);
...
...
@@ -132,6 +135,8 @@ class Notice extends Basic
}
$data
=
$this
->
m_push
->
getFeedInfo
(
'id,content,title'
);
$m_sile
=
new
SFile
();
$data
[
'annex_file_name'
]
=
$m_sile
->
getFileList
(
'id,file_name'
);
return
$this
->
response
(
200
,
""
,
$data
);
}
...
...
application/model/SFile.php
View file @
443545ed
...
...
@@ -59,4 +59,21 @@ class SFile extends BaseModel
return
0
;
}
}
/**
* @param string $field
* @param string $params
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getFileList
(
$field
=
''
,
$params
=
''
,
$order
=
'id ASC'
)
{
return
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order
)
->
select
();
}
}
\ 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