HomeCityModel.class.php 765 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Common\Model;
  3. use Common\Model\BaseModel;
  4. /**
  5. * 官网新闻
  6. * @author: linch
  7. * Class HomeCityModel
  8. * @package Common\Model
  9. */
  10. class HomeCityModel extends BaseModel
  11. {
  12. //使用x-motion.cn数据库
  13. protected $connection = 'DB_CONFIG_XMOTION';
  14. //软删状态
  15. const status_del = 0; //删除
  16. const status_on = 1; //正常
  17. protected $mod;
  18. public function __construct() {
  19. parent::__construct();
  20. $this->mod = M('home_city');
  21. }
  22. /**
  23. * 获取正常状态下的城市
  24. * @return mixed
  25. */
  26. public function get_data() {
  27. $where = array(
  28. 'status' => self::status_on,
  29. );
  30. $data = $this->where($where)->select();
  31. return $data;
  32. }
  33. }