Modbus_load_model.php 744 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. if (!defined('BASEPATH'))exit('No direct script access allowed');
  3. include_once(FCPATH . 'application/models/Base_model.php');
  4. class Modbus_load_model extends Base_model {
  5. protected $table = 'modbus_load_param_cmd';
  6. public function __construct() {
  7. parent::__construct();
  8. }
  9. public function get_data_by_filter($where){
  10. if (empty($where)) {
  11. return array();
  12. }
  13. $this->db->select('*');
  14. foreach ($where as $k => $v) {
  15. if (is_array($v)) {
  16. $this->db->where_in($k, $v);
  17. } else {
  18. $this->db->where($k,$v);
  19. }
  20. }
  21. $query = $this->db->get($this->table);
  22. return $query->row_array();
  23. }
  24. }
  25. ?>