PushplaceType.php 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 PushplaceType extends Common
  11. {
  12. public function rules()
  13. {
  14. return [
  15. // [['company','contact'],'required','message'=>'{attribute}不能为空'],
  16. // [['aptitude','copyright','privacy'],'string']
  17. ];
  18. }
  19. public function city1()
  20. {
  21. $city1 = self::find()->where(['type' => 1, 'state' => 1])->orderBy(['sort' => SORT_DESC, 'create_at' => SORT_DESC])->asArray()->all();
  22. return $city1;
  23. }
  24. public function city2()
  25. {
  26. $city2 = self::find()->where(['type' => 2, 'state' => 1])->orderBy(['sort' => SORT_DESC, 'create_at' => SORT_DESC])->asArray()->all();
  27. return $city2;
  28. }
  29. public function boutiquevilla()
  30. {
  31. $data = self::find()->where(['type' => 3, 'state' => 1])->limit(2)->orderBy(['sort' => SORT_DESC, 'create_at' => SORT_DESC])->asArray()->all();
  32. return $data;
  33. }
  34. }