Nhc.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\common\api;
  3. use think\facade\Db;
  4. /**
  5. * Description of Nhc
  6. * 卫健相关数据接口
  7. * @author sgq
  8. */
  9. class Nhc {
  10. /**
  11. * 获取医共体列表,按正序排
  12. * @return type
  13. */
  14. public static function getMedicalCommunityList() {
  15. $where = [];
  16. $where[] = ["status", "<>", 3];
  17. $list = Db::table("nhc_medical_community")->where($where)->order("num asc,createTime asc")->select()->toArray();
  18. return $list;
  19. }
  20. /**
  21. * 获取医共体键值对id,name
  22. * @return type
  23. */
  24. public static function getMedicalCommunityMap() {
  25. $list = Db::table("nhc_medical_community")->column("name", "id");
  26. return $list;
  27. }
  28. public static function hasGeneralHospital($medicalCommunityId) {
  29. $where = [];
  30. $where[] = ["type", "=", \app\common\state\CommonConst::ENTERPRISE_WJ];
  31. $where[] = ["medicalCommunityId", "=", $medicalCommunityId];
  32. $where[] = ["isGeneral", "=", 1];
  33. $where[] = ["checkState", "=", 3];
  34. $where[] = ["active", "=", 1];
  35. $where[] = ["delete", "=", 0];
  36. return \app\admin\model\Enterprise::where($where)->findOrEmpty()->toArray();
  37. }
  38. }