Index.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <?php
  2. namespace app\inter\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use think\Session;
  6. use think\Log;
  7. use app\common\library\UUIDs;
  8. use think\Cache;
  9. class Index extends Controller
  10. {
  11. public function _initialize()
  12. {
  13. /*var_dump($_SERVER);die;
  14. parent::_initialize(); // TODO: Change the autogenerated stub
  15. $param = $_REQUEST;
  16. var_dump($param);
  17. $sessionid = $param['sessionid'];
  18. $doctor = Cache::get($sessionid);
  19. var_dump($doctor);
  20. $dname = DB::table('doctors')->where('id',$doctor['id'])->field('realname')->find();
  21. $info['id'] = UUIDs::uuid16();
  22. $info['param'] = serialize($param);
  23. $info['doctor_id'] = $doctor['id'];
  24. $info['doctor_name'] = $dname['realname'];
  25. $info['url'] = $_SERVER['REQUEST_URI'];
  26. var_dump($info);die;*/
  27. }
  28. public function index(){
  29. $a = '127.0.0.111:80';
  30. $b = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/",$a);
  31. var_dump($b);
  32. $ip = explode(':',$a);
  33. return $ip[0];
  34. var_dump(STATUS_LOCAL);die;
  35. /*$a = DB::table('doctors')->where('institution_id','73090001')->select();
  36. foreach($a as $k=>$v){
  37. $c = DB::table('dr_cla_permission')->where('doctor_id',$v['id'])->where('pass','bdb52c21d1687709')->delete();
  38. $d = DB::table('dr_cla_permission')->where('doctor_id',$v['id'])->where('pass','0eac42ef01de23ff')->delete();
  39. }
  40. // bdb52c21d1687709 预约登记
  41. // 0eac42ef01de23ff 登记列表*/
  42. /* die;
  43. $doctor = '1';
  44. $dr = DB::table('dr_cla_permission')->where('doctor_id',1)->field('pass')->select();
  45. $a = array();
  46. $a['pass'] = '0eac42ef01de23ff';
  47. if(in_array($a,$dr)){
  48. echo 1;die;
  49. }
  50. foreach ($dr as $k => $v) {*/
  51. /*if($v['pass'] == 'bdb52c21d1687709'){
  52. //预约登记
  53. return json_encode(['status'=>'ok','code'=>'0000','info'=>'修改成功']);
  54. }*/
  55. /*switch($v['pass']){
  56. case 'bdb52c21d1687709':
  57. return '预约登记';
  58. break;
  59. case '0eac42ef01de23ff':
  60. //登记列表
  61. return '登记列表';
  62. break;
  63. case '80ddb7d09ebc44b4':
  64. //科室报告
  65. return '科室报告';
  66. break;
  67. }*/
  68. /*}
  69. die;*/
  70. // DR->DX
  71. /*$a = DB::table('templates')->where('is_public','1')->where('exam_class_id','DR')->select();
  72. foreach ($a as $k => $v) {
  73. $b = array();
  74. $p = DB::table('templates')->where('parent_id',$v['id'])->select();
  75. unset($v['exam_class_id']);
  76. unset($v['id']);
  77. $b = $v;
  78. $b['exam_class_id'] = 'DX';
  79. $b['id'] = UUIDs::uuid16();
  80. $c = DB::table('templates')->insert($b);
  81. foreach ($p as $key => $value) {
  82. unset($value['exam_class_id']);
  83. unset($value['id']);
  84. unset($value['parent_id']);
  85. $y = array();
  86. $y = $value;
  87. $y['exam_class_id'] = 'DX';
  88. $y['parent_id'] = $b['id'];
  89. $y['id'] = UUIDs::uuid16();
  90. DB::table('templates')->insert($y);
  91. }
  92. }
  93. die;*/
  94. // 菜单权限
  95. /*$a = DB::table('doctors')->where('institution_id','4400001')->select();
  96. $i = 1;
  97. foreach($a as $k=>$v){
  98. $info = array();
  99. $info['id'] = UUIDs::uuid16();
  100. $info['doctor_id'] = $v['id'];
  101. $info['pass'] = '80ddb7d09ebc44b4';
  102. $info['type'] = 1;
  103. $c = DB::table('dr_cla_permission')->insert($info);
  104. if($c){
  105. echo $i;
  106. $i++;
  107. }
  108. }
  109. die;*/
  110. // 报告权限
  111. $qx = DB::table('doctors')->where('institution_id','4400001')->select();
  112. foreach($qx as $k=>$v){
  113. $qxinfo = array();
  114. if($v['department_id'] == '4be1b7354592e3b3' || $v['department_id'] == '9156b1ddb9127c3b' || $v['department_id'] == '99037aa160453538'){
  115. // 写报告权限
  116. $qxinfo['doctor_class'] = '2,3,4,6';
  117. }else{
  118. $qxinfo['doctor_class'] = '1';
  119. }
  120. $qxinfo['department_id'] = $v['department_id'];
  121. $qxinfo['id'] = UUIDs::uuid16();
  122. $qxinfo['doctor_id'] = $v['id'];
  123. $qxx = DB::table('doctor_class')->insert($qxinfo);
  124. if(!$qxx){
  125. var_dump($qxinfo);
  126. }
  127. }
  128. die('over');
  129. $a = "select count(1) from templates where id='00'";
  130. $b = DB::query($a);
  131. var_dump($b);
  132. var_dump($b[0]['count(1)']);die;
  133. $c = DB::table('exam_class')->where('id',2)->find();
  134. var_dump($c);echo '<br>';
  135. $b = DB::table('templates')->where('exam_class_id',$c['name'])->where('create_user',1)->select();
  136. var_dump($b);die;
  137. var_dump(Cache::get('80f3d36662cddb97'));
  138. // Cache::clear();die;
  139. $a = model('app\inter\model\Exam')->select();
  140. // var_dump($a);die;
  141. // $this->uuids = new UUIDs();
  142. // $id = $this->uuids->uuid16();
  143. // var_dump($id);die;
  144. return json_encode(['status'=>'ok','code'=>'0000','info'=>$a]);
  145. }
  146. }