Operating.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. }
  26. }catch(\Exception $e){
  27. return json_encode(['status'=>'fail','code'=>'2000','msg'=>$e->getMessage()]);
  28. }
  29. }
  30. }