|
@@ -576,11 +576,32 @@ class NewsService implements NewsServiceInterface
|
|
|
'status' => 1,
|
|
|
];
|
|
|
var_dump($data, 'data-----------------');
|
|
|
-
|
|
|
+ // level=7 根据文章key来匹配文章
|
|
|
+ if (isset($data['level']) && $data['level'] == 7) {
|
|
|
+ // 根据文章id获取key
|
|
|
+ if (isset($data['id']) && !empty($data['id'])) {
|
|
|
+ $keyword = Article::where('id', $data['id'])->value('keyword');
|
|
|
+ $keywordArray = explode(',', $keyword);
|
|
|
+ $whereL7 = [];
|
|
|
+ foreach ($keywordArray as $k => $v) {
|
|
|
+ $whereL7[] = ['keyword', 'like', '%' . $v . '%'];
|
|
|
+ }
|
|
|
+ $result = Article::where($whereL7)
|
|
|
+ ->offset($placeid)
|
|
|
+ ->limit($data['pageSize'])
|
|
|
+ ->orderBy('updated_at', 'desc')
|
|
|
+ ->get();
|
|
|
+ if (empty($result)) {
|
|
|
+ return Result::success([]);
|
|
|
+ }
|
|
|
+ return Result::success($result);
|
|
|
+ } else {
|
|
|
+ return Result::error("参数错误", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
//如果是4:最新资讯(数据库已不存在) 5:资讯推荐(数据库已不存在);
|
|
|
// 1:头条资讯;2:轮播图;6:热点资讯;(数据库)
|
|
|
var_dump($where, 'where-----------------');
|
|
|
-
|
|
|
$result = Article::where($where)
|
|
|
->whereIn("catid", $category)
|
|
|
->where(function ($query) use ($data) {
|