Feedback_model.php 845 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. if (!defined('BASEPATH'))exit('No direct script access allowed');
  3. include_once(FCPATH . 'application/models/Base_model.php');
  4. class Feedback_model extends Base_model {
  5. protected $table = 'feedback';
  6. public function __construct() {
  7. parent::__construct();
  8. }
  9. public function queryData($usernames){
  10. if (!empty($usernames)) {
  11. $this->db->where_in('username', $usernames);
  12. }
  13. $this->db->order_by("status","asc");
  14. $query = $this->db->get($this->table);
  15. return $query->result_array();
  16. }
  17. public function delBatch($data, $field = 'id'){
  18. $this->db->where_in($field, $data);
  19. $this->db->delete($this->table);
  20. if ($this->db->affected_rows()) {
  21. return true;
  22. } else {
  23. return false;
  24. }
  25. }
  26. }
  27. ?>