Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
LC_api_news
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
0d3dafb4
authored
Dec 18, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更多的商品信息
parent
66ee30a9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
.env
app/Model/ArticleModel.php
app/Services/CaseService.php
app/Services/NoticeService.php
.env
View file @
0d3dafb4
...
...
@@ -27,8 +27,8 @@ REDIS_READ_PORT=6379
GOODS_SERVER_URL=http://lc_server_goods.cc
NOTICE_TYPE_ID=
CASE_TYPE_ID=
NOTICE_TYPE_ID=
37
CASE_TYPE_ID=
35
CACHE_DRIVER=
redis
CACHE_DRIVER=
file
QUEUE_DRIVER=sync
app/Model/ArticleModel.php
View file @
0d3dafb4
...
...
@@ -59,6 +59,7 @@ class ArticleModel extends BaseModel
$query
->
select
([
'type_id'
,
'type_name'
]);
},
])
->
where
(
'status'
,
1
)
->
where
(
$map
);
$total
=
$query
->
count
();
...
...
@@ -66,7 +67,7 @@ class ArticleModel extends BaseModel
->
orderBy
(
'art_id'
,
'desc'
)
->
get
()
->
toArray
();
return
compact
(
'data'
,
'total'
);
return
compact
(
'data'
,
'total'
);
}
public
function
getCase
(
$map
)
...
...
@@ -125,6 +126,7 @@ class ArticleModel extends BaseModel
->
with
([
'type'
,
])
->
where
(
'top_type_id'
,
$noticeTypeId
)
->
where
(
'status'
,
1
)
->
orderBy
(
'art_id'
,
'desc'
)
->
page
(
$page
,
$pageSize
)
->
get
();
...
...
app/Services/CaseService.php
View file @
0d3dafb4
...
...
@@ -72,6 +72,11 @@ class CaseService extends BaseService
$goodsInfo
=
$this
->
getGoodsInfo
(
$item
[
'goods_id'
]);
if
(
$goodsInfo
)
{
$item
[
'goods_info'
]
=
[
'class_id1'
=>
$goodsInfo
[
'class_id1'
],
'class_id1_name'
=>
$goodsInfo
[
'class_id1_name'
],
'class_id2'
=>
$goodsInfo
[
'class_id2'
],
'class_id2_name'
=>
$goodsInfo
[
'class_id2_name'
],
'brand_logo'
=>
$goodsInfo
[
'brand_logo'
],
'goods_id'
=>
$goodsInfo
[
'goods_id'
],
'goods_name'
=>
$goodsInfo
[
'goods_name'
],
'goods_image'
=>
is_array
(
$goodsInfo
[
'goods_images'
])
?
$goodsInfo
[
'goods_images'
][
0
]
:
$goodsInfo
[
'goods_images'
],
...
...
app/Services/NoticeService.php
View file @
0d3dafb4
...
...
@@ -12,7 +12,7 @@ class NoticeService extends BaseService
{
public
function
getNoticeList
(
$page
,
$pageSize
)
{
return
Cache
::
remember
(
"noticeListCache_
$page
"
.
"_
$pageSize
"
,
5
,
function
()
use
(
$page
,
$pageSize
)
{
return
Cache
::
remember
(
"noticeListCache_
$page
"
.
"_
$pageSize
"
,
1
,
function
()
use
(
$page
,
$pageSize
)
{
$model
=
new
ArticleModel
();
//获取所有faq相关的文章,50应该差不多了
$list
=
$model
->
getNoticeList
(
$page
,
$pageSize
);
...
...
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