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
e5ea5042
Commit
e5ea5042
authored
Jul 30, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商学院标签名
parent
ea5e8e11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
News.php
application/api_broker/controller/News.php
+11
-11
SNews.php
application/model/SNews.php
+13
-0
No files found.
application/api_broker/controller/News.php
View file @
e5ea5042
<?php
<?php
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
* User:
fuju
* User:
hu jun
* Date: 2018/6/12
* Date: 2018/6/12
* Time: 17:21
* Time: 17:21
*/
*/
...
@@ -79,16 +79,16 @@ class News extends Basic
...
@@ -79,16 +79,16 @@ class News extends Basic
return
$this
->
response
(
101
,
"Id is null."
);
return
$this
->
response
(
101
,
"Id is null."
);
}
}
$comment
=
new
SNewsComment
();
$comment
=
new
SNewsComment
();
$field_news
=
'id,title,s_label_id,cover_plan,content,create_time'
;
$field_news
=
'id,title,s_label_id,cover_plan,content,create_time'
;
$where_news
[
'status'
]
=
0
;
$where_news
[
'status'
]
=
0
;
$where_news
[
'id'
]
=
$this
->
params
[
'id'
];
$where_news
[
'id'
]
=
$this
->
params
[
'id'
];
$data
[
'news'
]
=
$this
->
m_news
->
getNewsInfo
(
$field_news
,
$where_news
);
$data
[
'news'
]
=
$this
->
m_news
->
getNewsInfo
(
$field_news
,
$where_news
);
$data
[
'news'
][
'label_name'
]
=
$this
->
m_news
->
getNewsLable
(
$data
[
'news'
][
's_label_id'
]);
$field
=
'a.id,a.comment_content,a.create_time,b.name,b.img'
;
$field
=
'a.id,a.comment_content,a.create_time,b.name,b.img'
;
$where
[
'a.s_news_id'
]
=
$this
->
params
[
'id'
];
$where
[
'a.s_news_id'
]
=
$this
->
params
[
'id'
];
$where
[
'a.status'
]
=
0
;
$where
[
'a.status'
]
=
0
;
$data
[
'comment'
]
=
$comment
->
getListAgent
(
1
,
3
,
'a.id DESC'
,
$field
,
$where
);
$data
[
'comment'
]
=
$comment
->
getListAgent
(
1
,
3
,
'a.id DESC'
,
$field
,
$where
);
return
$this
->
response
(
200
,
""
,
$data
);
return
$this
->
response
(
200
,
""
,
$data
);
}
}
...
...
application/model/SNews.php
View file @
e5ea5042
...
@@ -91,4 +91,16 @@ class SNews extends BaseModel
...
@@ -91,4 +91,16 @@ class SNews extends BaseModel
$comment_number
+=
1
;
$comment_number
+=
1
;
return
$this
->
where
(
'id'
,
$id
)
->
setField
(
'comment_number'
,
$comment_number
);
return
$this
->
where
(
'id'
,
$id
)
->
setField
(
'comment_number'
,
$comment_number
);
}
}
/**
* 根据s_label_id获取标签id名
*
* @param $id
* @param string $field
* @return mixed
*/
public
function
getNewsLable
(
$id
,
$field
=
'label_name'
)
{
$m_label
=
new
SLabel
();
return
$m_label
->
where
(
'id'
,
$id
)
->
value
(
$field
);
}
}
}
\ 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