12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace catchAdmin\worklocation\controller;
- use catchAdmin\wind\model\Fan;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\worklocation\model\Workplan as workplanModel;
- class Workplan extends CatchController
- {
- protected $workplanModel;
- public function __construct(WorkplanModel $workplanModel)
- {
- $this->workplanModel = $workplanModel;
- }
- /**
- * 列表
- * @time 2022年06月28日 09:51
- * @param Request $request
- */
- public function index(Request $request): \think\Response
- {
- return CatchResponse::paginate($this->workplanModel->getList());
- }
- /**
- * 保存信息
- * @time 2022年06月28日 09:51
- * @param Request $request
- */
- public function save(Request $request): \think\Response
- {
- return CatchResponse::success($this->workplanModel->storeBy($request->post()));
- }
- /**
- * 读取
- * @time 2022年06月28日 09:51
- * @param $id
- */
- public function read($id): \think\Response
- {
- return CatchResponse::success($this->workplanModel->findBy($id));
- }
- /**
- * 更新
- * @time 2022年06月28日 09:51
- * @param Request $request
- * @param $id
- */
- public function update(Request $request, $id): \think\Response
- {
- return CatchResponse::success($this->workplanModel->updateBy($id, $request->post()));
- }
- /**
- * 删除
- * @time 2022年06月28日 09:51
- * @param $id
- */
- public function delete($id): \think\Response
- {
- return CatchResponse::success($this->workplanModel->deleteBy($id, true));
- }
- public function getFanIdByWindId(Request $request)
- {
- $fan = new Fan();
- $data = $request->get();
- $list = [];
- $list = $fan->getFanListByWindId($data['id']);
- return CatchResponse::success($list);
- }
- }
|