Operating.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace app\inter\controller;
  3. use think\Controller;
  4. use think\Db;
  5. use app\common\library\UUIDs;
  6. use think\Session;
  7. use app\common\library\ResultTools;
  8. use think\Log;
  9. use think\Cache;
  10. class Operating extends Base
  11. {
  12. public function index(){
  13. }
  14. public function doctor(){
  15. try{
  16. $sessionid = $_REQUEST['sessionid'];
  17. log::record('-------运营------------');
  18. log::record($sessionid);
  19. $doctor = Cache::get($sessionid);
  20. log::record($doctor);
  21. log::record('-------------------');
  22. $operate = DB::table('operating')->where('type',1)->where('role_id',$doctor['id'])->field('nums,month,exam_num,remote_num,danger_num')->order('month asc')->limit(6)->select();
  23. if($operate){
  24. return json_encode(['code'=>'0000','status'=>'ok','msg'=>'请求成功','info'=>$operate,'sessionid'=>$sessionid]);
  25. }else{
  26. return json_encode(['code'=>'0000','status'=>'ok','msg'=>'请求成功','info'=>$operate,'sessionid'=>$sessionid]);
  27. }
  28. }catch(\Exception $e){
  29. return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
  30. }
  31. }
  32. public function getOperating(){
  33. $sessionid = $_REQUEST['sessionid'];
  34. $doctor = Cache::get($sessionid);
  35. $time = $_REQUEST['searchtime'];
  36. if($time){
  37. // where('id','between',[1,8]);
  38. }
  39. }
  40. }