Jcdw.php 905 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\api\model;
  3. use think\Model;
  4. /**
  5. * Created by PhpStorm
  6. * Author: ihavoc
  7. * Date: 2020/11/22
  8. * Time: 16:24
  9. *
  10. */
  11. class Jcdw extends model{
  12. protected $table = 't_jcdw';
  13. //主键定义为rybh:人员编号
  14. protected $pk = 'id';
  15. public function getInfoByLoginName($login_name)
  16. {
  17. if (empty($login_name)) {
  18. return false;
  19. }
  20. return $this->where('login_name','=', $login_name)->find();
  21. }
  22. public function getInfoById($id)
  23. {
  24. if (empty($id)) {
  25. return false;
  26. }
  27. return $this->where('id', '=', $id)->find();
  28. }
  29. public function getInfoList($where='',$pageNum=1,$pageSize=10)
  30. {
  31. return $this->where($where)->page($pageNum,$pageSize)->select();
  32. }
  33. public function getInfoListCount($where='')
  34. {
  35. return $this->where($where)->select()->count();
  36. }
  37. }