where('cate_name', 'LIKE', "%$where[cate_name]%"); $model = $model->where('status', 1); return self::page($model, function ($item) { $new = ArticleModel::where('id', 'in', $item['new_id'])->where('hide', 1)->select(); $item['new'] = $new; }); } /** * 获取一条图文 * @param int $id * @return array|false|\PDOStatement|string|\think\Model */ public static function getWechatNewsItem($id = 0) { if (!$id) return []; $list = self::where('id', $id)->where('status', 1)->field('cate_name as title,new_id')->find(); if ($list) { $list = $list->toArray(); $new = ArticleModel::where('id', 'in', $list['new_id'])->where('hide', 1)->select(); if ($new) $new = $new->toArray(); $list['new'] = $new; } return $list; } }