RfidWithBw.php 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace catchAdmin\alarm\model;
  3. use catcher\base\CatchModel as Model;
  4. class RfidWithBw extends Model
  5. {
  6. // 表名
  7. public $name = 'rfid_with_bw';
  8. // 数据库字段映射
  9. public $field = array(
  10. 'id',
  11. // 黑白名单id
  12. 'bw_id',
  13. // 标签
  14. 'rfid',
  15. 'rfid_type',
  16. // 创建人ID
  17. 'creator_id',
  18. // 创建时间
  19. 'created_at',
  20. // 更新时间
  21. 'updated_at',
  22. // 软删除
  23. 'deleted_at',
  24. );
  25. public function getList()
  26. {
  27. $res=$this->catchSearch()
  28. ->order($this->aliasField('id'), 'desc')
  29. ->paginate();
  30. return $res;
  31. }
  32. //根据姓名搜索
  33. public function searchBwIdAttr($query, $value, $data)
  34. {
  35. return $query->where('bw_id', $value);
  36. }
  37. }