$params['work_id'], 'admin_id' => $admin_id, 'content' => $params['content'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑工作汇报点评表 * @param array $params * @return bool * @author likeadmin * @date 2024/05/23 17:39 */ public static function edit(array $params): bool { Db::startTrans(); try { OaWorkComment::where('id', $params['id'])->update([ 'work_id' => $params['work_id'], 'content' => $params['content'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除工作汇报点评表 * @param array $params * @return bool * @author likeadmin * @date 2024/05/23 17:39 */ public static function delete(array $params): bool { return OaWorkComment::destroy($params['id']); } /** * @notes 获取工作汇报点评表详情 * @param $params * @return array * @author likeadmin * @date 2024/05/23 17:39 */ public static function detail($params): array { return OaWorkComment::findOrEmpty($params['id'])->toArray(); } }