<?php
/**
 * Created by PhpStorm.
 * User: xiaofeng
 * Date: 2018/3/4
 * Time: 上午9:25
 * ζŠ₯名
 */

namespace common\models;

class PushnewsType extends Common
{
    public function rules()
    {
        return [
        ];
    }

    public function getlist($limit)
    {
        $data = self::find()
            ->select('pfg_pushnews_type.create_at,pfg_pushnews_type.subhead,pfg_news.id,pfg_news.thumb,pfg_news.subject,pfg_news.abstract')
            ->where(['pfg_pushnews_type.state'=>1,'pfg_pushnews_type.type'=>1,'pfg_news.del'=>1])
            ->innerJoin('pfg_news','pfg_news.id = pfg_pushnews_type.nid')
            ->limit($limit)
            ->orderBy(['pfg_pushnews_type.sort'=>SORT_DESC,'pfg_pushnews_type.create_at'=>SORT_DESC])->asArray()->all();
        return $data;
    }
}