61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\adminapi\controller\tcm;
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
use app\adminapi\logic\tcm\ExerciseRecordLogic;
|
|
|
|
class ExerciseRecordController extends BaseAdminController
|
|
{
|
|
public function add()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = ExerciseRecordLogic::add($params);
|
|
if ($result) {
|
|
return $this->success('添加成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ExerciseRecordLogic::getError());
|
|
}
|
|
|
|
public function edit()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = ExerciseRecordLogic::edit($params);
|
|
if ($result) {
|
|
return $this->success('编辑成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ExerciseRecordLogic::getError());
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
$params = $this->request->post();
|
|
$result = ExerciseRecordLogic::delete($params);
|
|
if ($result) {
|
|
return $this->success('删除成功', [], 1, 1);
|
|
}
|
|
return $this->fail(ExerciseRecordLogic::getError());
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = ExerciseRecordLogic::detail($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
public function getRecordsByPatient()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = ExerciseRecordLogic::getRecordsByPatient($params);
|
|
return $this->data($result);
|
|
}
|
|
|
|
public function getExerciseTrend()
|
|
{
|
|
$params = $this->request->get();
|
|
$result = ExerciseRecordLogic::getExerciseTrend($params);
|
|
return $this->data($result);
|
|
}
|
|
}
|