mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update MediaService.php
This commit is contained in:
parent
3f50646503
commit
bf8a55e53b
@ -41,16 +41,15 @@ class MediaService extends Service
|
|||||||
public function news($id, array $map = []): array
|
public function news($id, array $map = []): array
|
||||||
{
|
{
|
||||||
// 文章主体数据
|
// 文章主体数据
|
||||||
$where = ['id' => $id, 'is_deleted' => 0];
|
$map1 = ['id' => $id, 'is_deleted' => 0];
|
||||||
$data = WechatNews::mk()->where($where)->where($map)->find();
|
$data = WechatNews::mk()->where($map1)->where($map)->find();
|
||||||
if (empty($data)) return [];
|
if (empty($data)) return [];
|
||||||
// 文章内容编号
|
// 文章内容编号
|
||||||
$data['articles'] = [];
|
$data['articles'] = [];
|
||||||
$data['articleids'] = str2arr($data['article_id']);
|
$aids = $data['articleids'] = str2arr($data['article_id']);
|
||||||
if (empty($data['articleids'])) return $data;
|
if (empty($data['articleids'])) return $data->toArray();
|
||||||
// 文章内容集合
|
// 文章内容集合
|
||||||
$query = WechatNewsArticle::mk();
|
$query = WechatNewsArticle::mk()->whereIn('id', $aids)->orderField('id', $aids);
|
||||||
$query->whereIn('id', $data['articleids'])->orderField('id', $data['articleids']);
|
|
||||||
$data['articles'] = $query->withoutField('create_by,create_at')->select()->toArray();
|
$data['articles'] = $query->withoutField('create_by,create_at')->select()->toArray();
|
||||||
return $data->toArray();
|
return $data->toArray();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user