Index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 = "select count(1) from templates where id='00'";
  30. $b = DB::query($a);
  31. var_dump($b);
  32. var_dump($b[0]['count(1)']);die;
  33. $c = DB::table('exam_class')->where('id',2)->find();
  34. var_dump($c);echo '<br>';
  35. $b = DB::table('templates')->where('exam_class_id',$c['name'])->where('create_user',1)->select();
  36. var_dump($b);die;
  37. var_dump(Cache::get('80f3d36662cddb97'));
  38. // Cache::clear();die;
  39. $a = model('app\inter\model\Exam')->select();
  40. // var_dump($a);die;
  41. // $this->uuids = new UUIDs();
  42. // $id = $this->uuids->uuid16();
  43. // var_dump($id);die;
  44. return json_encode(['status'=>'ok','code'=>'0000','info'=>$a]);
  45. }
  46. }