dataLists(new RosterLists()); } /** * @notes 保存排班(新增或更新) * @return \think\response\Json */ public function save() { $params = (new RosterValidate())->post()->goCheck('save'); $result = RosterLogic::save($params); return $this->success('保存成功', $result); } /** * @notes 删除排班 * @return \think\response\Json */ public function delete() { $params = (new RosterValidate())->post()->goCheck('delete'); RosterLogic::delete($params); return $this->success('删除成功'); } /** * @notes 排班详情 * @return \think\response\Json */ public function detail() { $params = (new RosterValidate())->goCheck('detail'); $result = RosterLogic::detail($params); return $this->data($result); } /** * @notes 批量保存排班 * @return \think\response\Json */ public function batchSave() { $params = (new RosterValidate())->post()->goCheck('batchSave'); $result = RosterLogic::batchSave($params); if ($result === false) { return $this->fail(RosterLogic::getError()); } return $this->success('批量保存成功', $result); } /** * @notes 复制排班 * @return \think\response\Json */ public function copy() { $params = (new RosterValidate())->post()->goCheck('copy'); $result = RosterLogic::copy($params); if ($result === false) { return $this->fail(RosterLogic::getError()); } return $this->success('复制成功', []); } }