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