inventrecmodel.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: sicilon_IT
  5. * Date: 2023/1/31
  6. * Time: 13:59
  7. */
  8. namespace app\index\model;
  9. use think\Model;
  10. class inventrecmodel extends Model{
  11. protected $table='t_inventworkerrec';
  12. /*
  13. * 20200308
  14. *
  15. */
  16. public function insinfo($arr){
  17. $res=$this->allowField(true)->save($arr);
  18. return $this->id;
  19. }
  20. /*
  21. * 20230131
  22. */
  23. public function selinfobywid($wid){
  24. $where_arr['workerid']=$wid;
  25. $where_arr['isaccept']=0;
  26. $rec=$this->where($where_arr)->order('id','desc')->find();
  27. return $rec;
  28. }
  29. /*
  30. * 20230131
  31. */
  32. public function updateacceptbyid($id){
  33. $where_arr['id']=$id;
  34. $where_arr['isaccept']=0;
  35. $update_arr['isaccept']=1;
  36. $update_arr['accpetdate']=date('Y-m-d');
  37. $rec=$this->where($where_arr)->update($update_arr);
  38. return $rec;
  39. }
  40. /*
  41. * 20230201
  42. */
  43. public function selinfobyid($id){
  44. $where_arr['id']=$id;
  45. $rec=$this->where($where_arr)->find();
  46. return $rec;
  47. }
  48. }