Station.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace catchAdmin\device\model;
  3. use \think\Model as Model;
  4. use catchAdmin\permissions\model\DataRangScopeTrait;
  5. use catchAdmin\device\model\get\StationGet;
  6. use think\facade\Db;
  7. class Station extends Model
  8. {
  9. use DataRangScopeTrait;
  10. use StationGet;
  11. protected $connection = 'oracle';
  12. // 表名
  13. public $name = 'dssc2.adm_dev';
  14. // 数据库字段映射
  15. public $field = array(
  16. );
  17. /**
  18. * 获取基站列表
  19. */
  20. public function getStationList($field, $order,$where=[])
  21. {
  22. $res = $this
  23. // ->dataRange()
  24. // ->catchSearch()
  25. ->where($where)
  26. ->alias('a')
  27. ->join('dssc2.adm_dev_rfid_chn n','a.DEVICE_CODE=n.DEVICE_CODE')
  28. ->field('a.ID,a.IS_ONLINE,a.LOGIN_NAME,a.DEVICE_CODE,a.DEVICE_NAME,a.OWNER_CODE,a.DEVICE_IP,a.DEVICE_PORT,to_char(a.UPDATE_DATE,\'yyyy-mm-dd hh24:mi:ss\') UPDATE_DATE,n.GPS_X as longitude,n.GPS_Y as latitude')
  29. // ->append(['depart_name', 'net_state', 'open_user_name', 'creator_name', 'model_text'])
  30. // ->order($this->aliasField($field), $order)
  31. ->paginate();
  32. // var_dump($this->getLastSql());
  33. return $res;
  34. }
  35. }