dataLists(new MasterWorkerTemporaryLists()); } /** * @notes 添加 * @return \think\response\Json * @author likeadmin * @date 2024/07/10 18:17 */ public function add() { $params = (new MasterWorkerTemporaryValidate())->post()->goCheck('add'); $result = MasterWorkerTemporaryLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(MasterWorkerTemporaryLogic::getError()); } /** * @notes 编辑 * @return \think\response\Json * @author likeadmin * @date 2024/07/10 18:17 */ public function edit() { $params = (new MasterWorkerTemporaryValidate())->post()->goCheck('edit'); $result = MasterWorkerTemporaryLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(MasterWorkerTemporaryLogic::getError()); } /** * @notes 删除 * @return \think\response\Json * @author likeadmin * @date 2024/07/10 18:17 */ public function delete() { $params = (new MasterWorkerTemporaryValidate())->post()->goCheck('delete'); MasterWorkerTemporaryLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取详情 * @return \think\response\Json * @author likeadmin * @date 2024/07/10 18:17 */ public function detail() { $params = (new MasterWorkerTemporaryValidate())->goCheck('detail'); $result = MasterWorkerTemporaryLogic::detail($params); return $this->data($result); } /** * 导入excel */ public function import() { $file = request()->file('file'); $result = MasterWorkerTemporaryLogic::import($file); if (true === $result) { return $this->success('导入成功', [], 1, 1); } return $this->fail(MasterWorkerTemporaryLogic::getError()); } }