InfoAudit.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\model\api;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class InfoAudit extends Model
  9. {
  10. public function getList(){
  11. }
  12. /**
  13. *
  14. * @param type $id
  15. * @param type $type
  16. */
  17. public function getItem($post){
  18. if(empty($parms)){
  19. return [];
  20. }
  21. $where=[];
  22. if(isset($post["status"]) && in_array((string)$post["status"], ["0","1"])){
  23. $where[]=["au.status","=",(int)$post["status"]];
  24. }
  25. if(!empty($post["id"])){
  26. $where[]=["au.id","=",$post["id"]];
  27. }
  28. if(!empty($post["uid"])){
  29. $where[]=["au.uid","=",$post["uid"]];
  30. }
  31. $data = (new InfoAudit)
  32. ->alias("au")
  33. ->field("au.*,wt.title as user_work_type_title,s.title as service_time_type_title")
  34. ->leftJoin("user_work_type wt" , "wt.id = au.user_work_type_id")//职称
  35. ->leftJoin("service_time_type s" , "s.code = au.service_type")//服务时长类型
  36. ->where($where)
  37. ->order("au.id","desc")
  38. ->find();
  39. }
  40. }