lgy 2 weeks ago
parent
commit
dcf87d334f

+ 11 - 6
jcjyhr/app/admin/controller/auth/Group.php

@@ -212,9 +212,9 @@ class Group extends Backend
         // 读取所有pid,全部从节点数组移除,父级选择状态由子级决定
         $pidArr = AdminRule::field('pid')
             ->distinct(true)
-            ->where('id', 'in', $row->rules)
+            ->where('id', 'in', $row->RULES)
             ->select()->toArray();
-        $rules  = $row->rules ? explode(',', $row->rules) : [];
+        $rules  = $row->RULES ? explode(',', $row->RULES) : [];
         foreach ($pidArr as $item) {
             $ruKey = array_search($item['pid'], $rules);
             if ($ruKey !== false) {
@@ -222,8 +222,13 @@ class Group extends Backend
             }
         }
         $row->rules = array_values($rules);
+        $arr = [];
+        foreach($row->toarray() as $k=>$v)
+        {
+            $arr[strtolower($k)] = $v;
+        }
         $this->success('', [
-            'row' => $row
+            'row' => $arr
         ]);
     }
 
@@ -255,8 +260,8 @@ class Group extends Backend
         $this->model->startTrans();
         try {
             foreach ($data as $v) {
-                if (!in_array($v['id'], $adminGroup)) {
-                    $count += $v->delete();
+                if (!in_array($v['ID'], $adminGroup)) {
+                    $count += $v->where('ID',$v['ID'])->delete();
                 }
             }
             $this->model->commit();
@@ -354,7 +359,7 @@ class Group extends Backend
             if (!$absoluteAuth) $authGroups = array_merge($this->adminGroups, $authGroups);
             $where[] = ['id', 'in', $authGroups];
         }
-        $field = ['ID','PID','ID AS id', 'PID AS pid','NAME AS name','RULES AS rules','STATUS AS status','UPDATE_TIME AS update_time','CREATE_TIME AS create_time'];
+        $field = ['ID','PID','NAME','ID AS id', 'PID AS pid','NAME AS name','RULES AS rules','STATUS AS status','UPDATE_TIME AS update_time','CREATE_TIME AS create_time'];
         $data = $this->model->where($where)->field($field)->select()->toArray();
 
         // 获取第一个权限的名称供列表显示-s

+ 3 - 3
jcjyhr/app/admin/library/Auth.php

@@ -502,10 +502,10 @@ class Auth extends \ba\Auth
         $allAuthGroups = [];
         $groups        = AdminGroup::where('status', '1')->select();
         foreach ($groups as $group) {
-            if ($group['rules'] == '*') {
+            if ($group['RULES'] == '*') {
                 continue;
             }
-            $groupRules = explode(',', $group['rules']);
+            $groupRules = explode(',', $group['RULES']);
 
             // 及时break, array_diff 等没有 in_array 快
             $all = true;
@@ -517,7 +517,7 @@ class Auth extends \ba\Auth
             }
             if ($all) {
                 if ($dataLimit == 'allAuth' || ($dataLimit == 'allAuthAndOthers' && array_diff($rules, $groupRules))) {
-                    $allAuthGroups[] = $group['id'];
+                    $allAuthGroups[] = $group['ID'];
                 }
             }
         }

+ 1 - 1
jcjyhr/app/admin/model/AdminGroup.php

@@ -9,5 +9,5 @@ use think\Model;
  */
 class AdminGroup extends Model
 {
-    protected $autoWriteTimestamp = true;
+    protected $autoWriteTimestamp = 'datetime';
 }

+ 1 - 2
jcjyhr/app/zskk/servies/PatientServies.php

@@ -536,7 +536,7 @@ class PatientServies
         $data['DIAGNOSECODE'] = $medical['DIAGNOSECODE'];
         $data['ORGCODE'] = $medical['ORGCODE'];
         // todo 
-        $data['create_time'] = $medical['ENCOUNTER_DATE'];
+        $data['create_time'] = date('Y-m-d H:i:s');
 
         return $data;
     }
@@ -978,7 +978,6 @@ class PatientServies
             foreach ($hosEmpi as $v)
             {
                 $information = $this->patientModel->getMedicalData(['HOS_EMPI'=>$v,'ORGCODE'=>$params['MEDICAL_INFORMATION']['ORGCODE']],'*');
-                var_dump($information);die;
                 if(empty($information))
                 {
                     return '';