| 
					
				 | 
			
			
				@@ -1,6 +1,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <?php 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-namespace app\admin\controller\hospital; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+namespace app\admin\controller\nhc; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use app\admin\common\AdminController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 use app\common\api\DictApi; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -10,7 +10,7 @@ use think\facade\Db; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  * 医共体管理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+class MedicalCommunity extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function index() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return view(""); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -28,20 +28,20 @@ class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["name", "like", "%" . $name . "%"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $count = Db::table("new_hospital_category")->where($where)->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $rows = Db::table("new_hospital_category")->where($where)->limit($offset, $limit)->order("num asc,createTime " . $order)->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $count = Db::table("nhc_medical_community")->where($where)->count(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $rows = Db::table("nhc_medical_community")->where($where)->limit($offset, $limit)->order("num asc,createTime " . $order)->select()->toArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return ["total" => $count, "rows" => $rows]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function add() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return view("update"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return view("edit"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function edit() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $id = \StrUtil::getRequestDecodeParam($this->request, 'id'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $info = Db::table("new_hospital_category")->where("id", $id)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return view("update", ["row" => $info]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $info = Db::table("nhc_medical_community")->where("id", $id)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return view("edit", ["row" => $info]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public function upsert() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -50,10 +50,10 @@ class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $id = \StrUtil::getRequestDecodeParam($this->request, 'id'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where = []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $info = Db::table("new_hospital_category")->where("id", $id)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $info = Db::table("nhc_medical_community")->where("id", $id)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!$info) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $response_obj->msg = '找不到记录'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return \StrUtil::back($response_obj, 'CategoryInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return \StrUtil::back($response_obj, 'MedicalCommunityInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $where[] = ["id", "<>", $id]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -61,25 +61,25 @@ class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $name = trim($this->request['name']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (\StrUtil::isEmpOrNull($name)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = '医共体名称不能为空'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, 'CategoryInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, 'MedicalCommunityInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $where[] = ["name", "=", $name]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $repeat = Db::table("new_hospital_category")->where($where)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $repeat = Db::table("nhc_medical_community")->where($where)->find(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if ($repeat) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = '医共体名称已经被使用'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, 'CategoryInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, 'MedicalCommunityInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $num = trim($this->request['num']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (\StrUtil::isNotEmpAndNull($num) && !is_numeric($num)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = '序号只能是数字'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, 'CategoryInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, 'MedicalCommunityInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $status = trim($this->request['status']); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (\StrUtil::isEmpOrNull($status)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = '启用状态不能为空'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, 'CategoryInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, 'MedicalCommunityInfo.callBack'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $data["name"] = $name; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -90,18 +90,18 @@ class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $data["id"] = $id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $data["updateTime"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $data["updateUser"] = $this->user['uid']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                Db::table("new_hospital_category")->save($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Db::table("nhc_medical_community")->save($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $data["createTime"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $data["createUser"] = $this->user['uid']; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                Db::table("new_hospital_category")->insert($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Db::table("nhc_medical_community")->insert($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->code = 200; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = '修改成功'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, "CategoryInfo.callBack"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, "MedicalCommunityInfo.callBack"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (\Exception $e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $response_obj->msg = $e->getMessage(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            return \StrUtil::back($response_obj, "CategoryInfo.callBack"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            return \StrUtil::back($response_obj, "MedicalCommunityInfo.callBack"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -115,7 +115,7 @@ class Category extends AdminController { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $data["updateTime"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $data["updateUser"] = $this->user["uid"]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Db::table("new_hospital_category")->save($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Db::table("nhc_medical_community")->save($data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(['code' => 200, 'msg' => "删除成功"]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } catch (\Exception $e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return json(['code' => 500, 'msg' => $e->getMessage()]); 
			 |