PushnewsType.php 797 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/4
  6. * Time: 上午9:25
  7. * 报名
  8. */
  9. namespace common\models;
  10. class PushnewsType extends Common
  11. {
  12. public function rules()
  13. {
  14. return [
  15. ];
  16. }
  17. public function getlist($limit)
  18. {
  19. $data = self::find()
  20. ->select('pfg_pushnews_type.create_at,pfg_pushnews_type.subhead,pfg_news.id,pfg_news.thumb,pfg_news.subject,pfg_news.abstract')
  21. ->where(['pfg_pushnews_type.state'=>1,'pfg_pushnews_type.type'=>1,'pfg_news.del'=>1])
  22. ->innerJoin('pfg_news','pfg_news.id = pfg_pushnews_type.nid')
  23. ->limit($limit)
  24. ->orderBy(['pfg_pushnews_type.sort'=>SORT_DESC,'pfg_pushnews_type.create_at'=>SORT_DESC])->asArray()->all();
  25. return $data;
  26. }
  27. }