SpecialTopic.php 639 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace common\models;
  3. class SpecialTopic extends Common
  4. {
  5. public function rules()
  6. {
  7. return [
  8. ['hids','required','message'=>'楼盘ID不能为空'],
  9. [['hids','zt_name','pc_img','m_img','expiration_date'],'string',],
  10. ];
  11. }
  12. public function getList($page)
  13. {
  14. $query = self::find();
  15. $data['count'] = $query->count();
  16. if (!empty($page['page'])) {
  17. $query->offset = ($page['page'] - 1) * $page['limit'];
  18. $query->limit = $page['limit'];
  19. }
  20. $data['data'] = $query->asArray()->all();
  21. return $data;
  22. }
  23. }