recuitmodel.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: sicilon_IT
  5. * Date: 2020/4/15
  6. * Time: 15:52
  7. */
  8. namespace app\index\model;
  9. use think\Model;
  10. class recuitmodel extends Model{
  11. protected $table='t_recuit';
  12. public function insinfo($arr){
  13. $this->allowField(true)->save($arr);
  14. return $this->id;
  15. }
  16. public function selulistbyrecuit($recuit){
  17. $where_arr['recuituserid']=$recuit;
  18. $rlist=$this->where($where_arr)->order('indate','asc')->select();
  19. return $rlist;
  20. }
  21. /*
  22. * 20200416
  23. * 获取所有的数据
  24. */
  25. public function selrlist(){
  26. $strsql="select *";
  27. $strsql=$strsql." from t_recuit";
  28. $rlist=$this->query($strsql);
  29. return $rlist;
  30. }
  31. /*
  32. * 20200421
  33. */
  34. public function selruserlist(){
  35. $strsql="select DISTINCT recuituserid ";
  36. $strsql=$strsql." from t_recuit";
  37. $ulist=$this->query($strsql);
  38. $ulist=collection($ulist)->toArray();
  39. return $ulist;
  40. }
  41. /*
  42. * 20200503
  43. * 判断某人是否是被推荐的,以确认是否计划招人成本
  44. */
  45. public function selrecuitinfobyuserid($uid){
  46. $where_arr['userid']=$uid;
  47. $rec=$this->where($where_arr)->find();
  48. return $rec;
  49. }
  50. /*
  51. * 20200817
  52. * 获取所有的被推荐了
  53. */
  54. public function seluserlist(){
  55. $strsql="select userid ";
  56. $strsql=$strsql." from t_recuit";
  57. $ulist=$this->query($strsql);
  58. $ulist=collection($ulist)->toArray();
  59. return $ulist;
  60. }
  61. }