contactmodel.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: sicilon_IT
  5. * Date: 2020/3/8
  6. * Time: 16:48
  7. */
  8. namespace app\index\model;
  9. use think\Model;
  10. class contactmodel extends Model{
  11. protected $table='t_contact';
  12. /*
  13. * 20200308
  14. * 执行合同
  15. */
  16. public function insinfo($arr){
  17. $res=$this->allowField(true)->save($arr);
  18. return $this->id;
  19. }
  20. /*
  21. * 20200308
  22. * 查询工地下的所有合同
  23. */
  24. public function selclistbypid($pid){
  25. $rlist=$this->where('pid',$pid)->select();
  26. return $rlist;
  27. }
  28. /*
  29. * 20200320
  30. * 查询所有有效的合同,
  31. */
  32. public function selectclistbyacitve(){
  33. $rlist=$this->where('isacitve',1)->select();
  34. return $rlist;
  35. }
  36. /*
  37. * 20200309
  38. * 根据ID查合同信息
  39. */
  40. public function selcinfobycid($cid){
  41. $rec=$this->where('id',$cid)->find();
  42. return $rec;
  43. }
  44. /*
  45. * 20230215
  46. */
  47. public function sellistbycid($cid){
  48. $where_arr['isacitve']=1;
  49. $where_arr['companyid']=$cid;
  50. $rlist=$this->where($where_arr)->select();
  51. return $rlist;
  52. }
  53. }