mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修复图文不存在时的异常
This commit is contained in:
parent
fb118970a4
commit
429bc624af
@ -39,7 +39,8 @@ class MediaService extends Service
|
|||||||
{
|
{
|
||||||
// 文章主体数据
|
// 文章主体数据
|
||||||
$data = $this->app->db->name('WechatNews')->where(['id' => $id])->where($where)->find();
|
$data = $this->app->db->name('WechatNews')->where(['id' => $id])->where($where)->find();
|
||||||
list($data['articles'], $articleIds) = [[], explode(',', $data['article_id'])];
|
if (empty($data)) return [];
|
||||||
|
[$data['articles'], $articleIds] = [[], explode(',', $data['article_id'])];
|
||||||
if (empty($data['article_id']) || empty($articleIds)) return $data;
|
if (empty($data['article_id']) || empty($articleIds)) return $data;
|
||||||
// 文章列表组合
|
// 文章列表组合
|
||||||
$query = $this->app->db->name('WechatNewsArticle')->whereIn('id', $articleIds)->orderField('id', $articleIds);
|
$query = $this->app->db->name('WechatNewsArticle')->whereIn('id', $articleIds)->orderField('id', $articleIds);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user