fixed
This commit is contained in:
66
digital_doctor/application/api/controller/Hdradmin.php
Normal file
66
digital_doctor/application/api/controller/Hdradmin.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2024/8/7} {13:50}
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\Mmodel;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
|
||||
class Hdradmin extends BaseHttpApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:管理员登录
|
||||
* api/Hdradmin/adminLogin
|
||||
* author:wh
|
||||
*/
|
||||
function adminLogin(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('参数错误:1');
|
||||
}
|
||||
$password = input('password');
|
||||
if(empty($password)){
|
||||
return Tools::set_fail('参数错误:2');
|
||||
}
|
||||
$user = Db::table(TabConf::$fa_hdradmin)
|
||||
->where('username',$username)
|
||||
->find();
|
||||
if(empty($user)){
|
||||
return Tools::set_fail('用户不存在');
|
||||
}
|
||||
if($password != $user['password']){
|
||||
return Tools::set_fail('密码错误');
|
||||
}
|
||||
|
||||
//session('api_user_info',$user);
|
||||
|
||||
unset($user['password']);
|
||||
|
||||
$expires = 7*86400+time();//报告完成之后重新获取票据
|
||||
|
||||
|
||||
//返回票据
|
||||
$ticketstr = md5($user['username'].$expires);
|
||||
|
||||
//修改有效期
|
||||
Db::table('fa_tt_users')
|
||||
->data([
|
||||
'ticket'=>$ticketstr,
|
||||
'expires'=>$expires,//7天
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -181,6 +181,8 @@ class Reporttt extends BaseHttpApi
|
||||
Db::startTrans();
|
||||
try {
|
||||
foreach ($data as $item){
|
||||
//统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)->insert($item);
|
||||
//只新增不修改
|
||||
$DATAID = Db::table('fa_tt_userbaseinfo')->insert($basedata);
|
||||
//保存疼痛科聊天记录
|
||||
@@ -190,8 +192,6 @@ class Reporttt extends BaseHttpApi
|
||||
Db::table('fa_tt_medical_report')->insert($item);
|
||||
//日期
|
||||
$item['date'] = date('Y-m-d');
|
||||
//统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)->insert($item);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
|
||||
@@ -125,12 +125,24 @@ class TabConf
|
||||
static $fa_hdr_sms_record = 'fa_hdr_sms_record';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员
|
||||
*/
|
||||
static $fa_hdradmin = 'fa_hdradmin';
|
||||
|
||||
|
||||
/**
|
||||
* 科室
|
||||
*/
|
||||
static $fa_hdrdepartment = 'fa_hdrdepartment';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账户信息
|
||||
*/
|
||||
static $fa_hdrdoctorusers = 'fa_hdrdoctorusers';
|
||||
|
||||
|
||||
/**
|
||||
* 统一随访记录
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user