get('user does login')); } $where = []; $where[] = ['status','=',1]; // $where[] = ['time','>',date("Y-m-d H:i:s",strtotime('-1 week'))]; if (!empty($_POST['type'])) { $where[] = ['type','=',$_POST['type']]; } if(!empty($_POST['id'])){ $where[] = ['article.id','=',$_POST['id']]; } $data = lm('article', "api") ->join('article_type','article_type.id','article.type') ->select('article.id','identity','title','content','time','author','type','article_type.cate_name','status','img','article.sort') ->where($where) ->limit(5) ->get() ->toArray(); return $data; } }