123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <?php
- namespace app\inter\controller;
- use think\Controller;
- use think\Db;
- use think\Session;
- use think\Log;
- use app\common\library\UUIDs;
- use think\Cache;
- class Index extends Controller
- {
- public function _initialize()
- {
- /*var_dump($_SERVER);die;
- parent::_initialize(); // TODO: Change the autogenerated stub
- $param = $_REQUEST;
- var_dump($param);
- $sessionid = $param['sessionid'];
- $doctor = Cache::get($sessionid);
- var_dump($doctor);
- $dname = DB::table('doctors')->where('id',$doctor['id'])->field('realname')->find();
- $info['id'] = UUIDs::uuid16();
- $info['param'] = serialize($param);
- $info['doctor_id'] = $doctor['id'];
- $info['doctor_name'] = $dname['realname'];
- $info['url'] = $_SERVER['REQUEST_URI'];
- var_dump($info);die;*/
- }
- public function index(){
- $a = '127.0.0.111:80';
- $b = preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/",$a);
- var_dump($b);
- $ip = explode(':',$a);
- return $ip[0];
- var_dump(STATUS_LOCAL);die;
- /*$a = DB::table('doctors')->where('institution_id','73090001')->select();
- foreach($a as $k=>$v){
- $c = DB::table('dr_cla_permission')->where('doctor_id',$v['id'])->where('pass','bdb52c21d1687709')->delete();
- $d = DB::table('dr_cla_permission')->where('doctor_id',$v['id'])->where('pass','0eac42ef01de23ff')->delete();
- }
- // bdb52c21d1687709 预约登记
- // 0eac42ef01de23ff 登记列表*/
- /* die;
- $doctor = '1';
- $dr = DB::table('dr_cla_permission')->where('doctor_id',1)->field('pass')->select();
- $a = array();
- $a['pass'] = '0eac42ef01de23ff';
- if(in_array($a,$dr)){
- echo 1;die;
- }
- foreach ($dr as $k => $v) {*/
- /*if($v['pass'] == 'bdb52c21d1687709'){
- //预约登记
- return json_encode(['status'=>'ok','code'=>'0000','info'=>'修改成功']);
- }*/
- /*switch($v['pass']){
- case 'bdb52c21d1687709':
- return '预约登记';
- break;
- case '0eac42ef01de23ff':
- //登记列表
- return '登记列表';
- break;
- case '80ddb7d09ebc44b4':
- //科室报告
- return '科室报告';
- break;
- }*/
- /*}
- die;*/
- // DR->DX
- /*$a = DB::table('templates')->where('is_public','1')->where('exam_class_id','DR')->select();
- foreach ($a as $k => $v) {
- $b = array();
- $p = DB::table('templates')->where('parent_id',$v['id'])->select();
- unset($v['exam_class_id']);
- unset($v['id']);
- $b = $v;
- $b['exam_class_id'] = 'DX';
- $b['id'] = UUIDs::uuid16();
- $c = DB::table('templates')->insert($b);
- foreach ($p as $key => $value) {
- unset($value['exam_class_id']);
- unset($value['id']);
- unset($value['parent_id']);
- $y = array();
- $y = $value;
- $y['exam_class_id'] = 'DX';
- $y['parent_id'] = $b['id'];
- $y['id'] = UUIDs::uuid16();
- DB::table('templates')->insert($y);
- }
- }
- die;*/
- // 菜单权限
- /*$a = DB::table('doctors')->where('institution_id','4400001')->select();
- $i = 1;
- foreach($a as $k=>$v){
- $info = array();
- $info['id'] = UUIDs::uuid16();
- $info['doctor_id'] = $v['id'];
- $info['pass'] = '80ddb7d09ebc44b4';
- $info['type'] = 1;
- $c = DB::table('dr_cla_permission')->insert($info);
- if($c){
- echo $i;
- $i++;
- }
- }
- die;*/
- // 报告权限
- $qx = DB::table('doctors')->where('institution_id','4400001')->select();
- foreach($qx as $k=>$v){
- $qxinfo = array();
- if($v['department_id'] == '4be1b7354592e3b3' || $v['department_id'] == '9156b1ddb9127c3b' || $v['department_id'] == '99037aa160453538'){
- // 写报告权限
- $qxinfo['doctor_class'] = '2,3,4,6';
- }else{
- $qxinfo['doctor_class'] = '1';
- }
- $qxinfo['department_id'] = $v['department_id'];
- $qxinfo['id'] = UUIDs::uuid16();
- $qxinfo['doctor_id'] = $v['id'];
- $qxx = DB::table('doctor_class')->insert($qxinfo);
- if(!$qxx){
- var_dump($qxinfo);
- }
- }
- die('over');
- $a = "select count(1) from templates where id='00'";
- $b = DB::query($a);
- var_dump($b);
- var_dump($b[0]['count(1)']);die;
- $c = DB::table('exam_class')->where('id',2)->find();
- var_dump($c);echo '<br>';
- $b = DB::table('templates')->where('exam_class_id',$c['name'])->where('create_user',1)->select();
- var_dump($b);die;
- var_dump(Cache::get('80f3d36662cddb97'));
- // Cache::clear();die;
- $a = model('app\inter\model\Exam')->select();
- // var_dump($a);die;
- // $this->uuids = new UUIDs();
- // $id = $this->uuids->uuid16();
- // var_dump($id);die;
- return json_encode(['status'=>'ok','code'=>'0000','info'=>$a]);
- }
- }
|