Jcdw.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 getLiteInfoById($id)
  30. {
  31. if (empty($id)) {
  32. return false;
  33. }
  34. return $this->where('id', '=', $id)->field('name,address,user_fzr,phone_fzr,email')->find();
  35. }
  36. public function getInfoList($where='',$pageNum=1,$pageSize=10)
  37. {
  38. return $this->where($where)->page($pageNum,$pageSize)->select();
  39. }
  40. public function getInfoListCount($where='')
  41. {
  42. return $this->where($where)->select()->count();
  43. }
  44. }