VM暫存
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 line
2.2KB

  1. <?php
  2. if (!defined('BASEPATH')) exit('No direct script access allowed');
  3. class Cario_seat_model extends CI_Model {
  4. public function __construct() {
  5. parent::__construct();
  6. $this->db=$this->load->database();
  7. $this->db3=$this->load->database('local', TRUE);
  8. }
  9. public function sel_cario($sin_time,$ein_time) {
  10. $this->db3->select('cario_no, station_no, obj_id as lpr, in_out, in_lane, in_time as in_lane_datetime, out_time as out_lane_datetime, out_lane')
  11. ->from('cario')
  12. ->where('in_time>=',$sin_time)
  13. ->where('in_time<',$ein_time)
  14. ->order_by('cario_no asc');
  15. $rows = $this->db3->get();
  16. return $rows->result_array();
  17. }
  18. public function sel_cario_seat_log($cario_no) {
  19. $this->db3->from('cario_seat_log')
  20. ->where('cario_no',$cario_no)
  21. ->order_by('cario_no asc');
  22. $rows = $this->db3->get();
  23. return $rows->result_array();
  24. }
  25. public function insert_cario_seat_log($data) {
  26. $this->db3->insert('cario_seat_log',$data);
  27. $sqlString = $this->db3->last_query();
  28. }
  29. public function update_cario_seat_log($cario_no,$data) {
  30. $this->db3->where('cario_no',$cario_no)
  31. ->update('cario_seat_log',$data);
  32. $sqlString = $this->db3->last_query();
  33. }
  34. public function sel_cario_seat($sin_time,$ein_time) {
  35. $this->db3->select('*')
  36. ->from('cario_seat_log')
  37. ->where('in_lane_datetime>=',$sin_time)
  38. ->where('in_lane_datetime<',$ein_time)
  39. ->order_by('cario_no asc');
  40. $rows = $this->db3->get();
  41. return $rows->result_array();
  42. }
  43. public function sel_cario_lpr($obj_id) {
  44. $this->db3->select('*')
  45. ->from('cario')
  46. ->where('obj_id',$obj_id)
  47. ->order_by('in_time desc')
  48. ->limit('1');
  49. $rows = $this->db3->get();
  50. return $rows->result_array();
  51. }
  52. }