123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace app\common\api;
- use think\facade\Db;
- /**
- * Description of Nhc
- * 卫健相关数据接口
- * @author sgq
- */
- class Nhc {
- /**
- * 获取医共体列表,按正序排
- * @return type
- */
- public static function getMedicalCommunityList() {
- $where = [];
- $where[] = ["status", "<>", 3];
- $list = Db::table("nhc_medical_community")->where($where)->order("num asc,createTime asc")->select()->toArray();
- return $list;
- }
- /**
- * 获取医共体键值对id,name
- * @return type
- */
- public static function getMedicalCommunityMap() {
- $list = Db::table("nhc_medical_community")->column("name", "id");
- return $list;
- }
- public static function hasGeneralHospital($medicalCommunityId) {
- $where = [];
- $where[] = ["type", "=", \app\common\state\CommonConst::ENTERPRISE_WJ];
- $where[] = ["medicalCommunityId", "=", $medicalCommunityId];
- $where[] = ["isGeneral", "=", 1];
- $where[] = ["checkState", "=", 3];
- $where[] = ["active", "=", 1];
- $where[] = ["delete", "=", 0];
- return \app\admin\model\Enterprise::where($where)->findOrEmpty()->toArray();
- }
- }
|