93 lines
2.4 KiB
PHP
93 lines
2.4 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\adminapi\controller\tcm;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\logic\tcm\BloodRecordLogic;
|
|
|
|
/**
|
|
* 血糖血压记录控制器
|
|
* Class BloodRecordController
|
|
* @package app\adminapi\controller\tcm
|
|
*/
|
|
class BloodRecordController extends BaseAdminController
|
|
{
|
|
/**
|
|
* @notes 添加记录
|
|
* @return \think\response\Json
|
|
*/
|
|
public function add()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = BloodRecordLogic::add($params);
|
|
if ($result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(BloodRecordLogic::getError());
|
|
}
|
|
|
|
/**
|
|
* @notes 编辑记录
|
|
* @return \think\response\Json
|
|
*/
|
|
public function edit()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = BloodRecordLogic::edit($params);
|
|
if ($result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(BloodRecordLogic::getError());
|
|
}
|
|
|
|
/**
|
|
* @notes 删除记录
|
|
* @return \think\response\Json
|
|
*/
|
|
public function delete()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = BloodRecordLogic::delete($params);
|
|
if ($result) {
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
return $this->fail(BloodRecordLogic::getError());
|
|
}
|
|
|
|
/**
|
|
* @notes 记录详情
|
|
* @return \think\response\Json
|
|
*/
|
|
public function detail()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = BloodRecordLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
/**
|
|
* @notes 获取患者的记录列表
|
|
* @return \think\response\Json
|
|
*/
|
|
public function getRecordsByPatient()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = BloodRecordLogic::getRecordsByPatient($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
/**
|
|
* @notes 获取血糖趋势图数据
|
|
* @return \think\response\Json
|
|
*/
|
|
public function getBloodSugarTrend()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = BloodRecordLogic::getBloodSugarTrend($params);
|
|
return $this->data($result);
|
|
}
|
|
}
|