Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
ruer_cms
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蔡闯
ruer_cms
Commits
03734d37
Commit
03734d37
authored
Feb 05, 2021
by
蔡闯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2020-2-5
parent
f30d1b87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
app/api/controller/Index.php
app/api/controller/Index.php
+1
-1
app/api/controller/News.php
app/api/controller/News.php
+8
-2
app/api/controller/Payreturn.php
app/api/controller/Payreturn.php
+0
-1
No files found.
app/api/controller/Index.php
View file @
03734d37
...
@@ -28,7 +28,7 @@ class Index extends Base
...
@@ -28,7 +28,7 @@ class Index extends Base
}
}
//首页推荐新闻
//首页推荐新闻
$news
=
Db
::
name
(
'news'
)
->
where
([
'village_id'
=>
$data
[
'village_id'
],
'is_recommend'
=>
1
])
->
order
(
'recommend_sort_id'
,
'desc'
)
$news
=
Db
::
name
(
'news'
)
->
where
([
'village_id'
=>
$data
[
'village_id'
],
'is_recommend'
=>
1
])
->
order
(
'recommend_sort_id'
,
'desc'
)
->
field
(
'title,pic,content'
)
->
field
(
'
news_id,
title,pic,content'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
->
select
()
->
toArray
();
foreach
(
$news
as
$k
=>
$v
)
{
foreach
(
$news
as
$k
=>
$v
)
{
...
...
app/api/controller/News.php
View file @
03734d37
...
@@ -21,7 +21,7 @@ class News extends Base{
...
@@ -21,7 +21,7 @@ class News extends Base{
$type_id
=
Request
::
param
(
'type_id'
);
$type_id
=
Request
::
param
(
'type_id'
);
$page
=
Request
::
param
(
'page'
,
1
);
$page
=
Request
::
param
(
'page'
,
1
);
$where
[
'news_type_id'
]
=
$type_id
;
$where
[
'news_type_id'
]
=
$type_id
;
$data
=
Db
::
name
(
'news'
)
->
where
(
$where
)
->
page
(
$page
,
config
(
'app.limit'
))
->
order
([
'sort_id'
=>
'desc'
,
'create_time'
=>
'desc'
])
->
field
(
'news_id,title,content,create_time'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
$data
=
Db
::
name
(
'news'
)
->
where
(
$where
)
->
page
(
$page
,
config
(
'app.limit'
))
->
order
([
'sort_id'
=>
'desc'
,
'create_time'
=>
'desc'
])
->
field
(
'news_id,title,content,create_time
,pic
'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
'content'
]
=
mb_substr
(
strip_tags
(
$v
[
'content'
]),
0
,
100
);
$data
[
$k
][
'content'
]
=
mb_substr
(
strip_tags
(
$v
[
'content'
]),
0
,
100
);
}
}
...
@@ -57,8 +57,11 @@ class News extends Base{
...
@@ -57,8 +57,11 @@ class News extends Base{
public
function
noticeList
()
{
public
function
noticeList
()
{
$where
[
'village_id'
]
=
Request
::
param
(
'village_id'
);
$where
[
'village_id'
]
=
Request
::
param
(
'village_id'
);
$page
=
Request
::
param
(
'page'
,
1
);
$page
=
Request
::
param
(
'page'
,
1
);
$data
=
Db
::
name
(
'notice'
)
->
order
([
'sort_id'
=>
'desc'
,
'create_time'
=>
'desc'
])
->
where
(
$where
)
->
field
(
'notice_id,title,author,create_time'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
$data
=
Db
::
name
(
'notice'
)
->
order
([
'sort_id'
=>
'desc'
,
'create_time'
=>
'desc'
])
->
where
(
$where
)
->
field
(
'notice_id,title,author,create_time
,content
'
)
->
page
(
$page
,
config
(
'app.limit'
))
->
select
()
->
toArray
();
$total
=
Db
::
name
(
'notice'
)
->
where
(
$where
)
->
count
();
$total
=
Db
::
name
(
'notice'
)
->
where
(
$where
)
->
count
();
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
'content'
]
=
mb_substr
(
strip_tags
(
$v
[
'content'
]),
0
,
100
);
}
$res
[
'total'
]
=
$total
;
$res
[
'total'
]
=
$total
;
$res
[
'data'
]
=
Common
::
changeField
(
$data
);
$res
[
'data'
]
=
Common
::
changeField
(
$data
);
return
$this
->
returnJson
(
$res
);
return
$this
->
returnJson
(
$res
);
...
@@ -73,4 +76,7 @@ class News extends Base{
...
@@ -73,4 +76,7 @@ class News extends Base{
}
}
\ No newline at end of file
app/api/controller/Payreturn.php
View file @
03734d37
...
@@ -64,7 +64,6 @@ class Payreturn extends BaseController
...
@@ -64,7 +64,6 @@ class Payreturn extends BaseController
}
}
Db
::
name
(
'pay_order'
)
->
where
(
$where
)
->
save
(
$save
);
Db
::
name
(
'pay_order'
)
->
where
(
$where
)
->
save
(
$save
);
Db
::
name
(
'cost'
)
->
where
(
'cost_id'
,
'in'
,
$cost_ids_arr
)
->
save
(
$save
);
Db
::
name
(
'cost'
)
->
where
(
'cost_id'
,
'in'
,
$cost_ids_arr
)
->
save
(
$save
);
Db
::
commit
();
Db
::
commit
();
return
true
;
return
true
;
}
catch
(
\Exception
$e
){
}
catch
(
\Exception
$e
){
...
...
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