$params['Uid'], 'Desc' => $params['Desc'], 'BeforeVal' => $params['BeforeVal'], 'AfterVal' => $params['AfterVal'], 'Key' => $params['Key'], 'Val' => $params['Val'], 'Action' => $params['Action'], 'LogTime' => $params['LogTime'] ]); 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/03/25 10:39 */ public static function edit(array $params): bool { Db::startTrans(); try { ResourceLogDaodao::where('Id', $params['Id'])->update([ 'Uid' => $params['Uid'], 'Desc' => $params['Desc'], 'BeforeVal' => $params['BeforeVal'], 'AfterVal' => $params['AfterVal'], 'Key' => $params['Key'], 'Val' => $params['Val'], 'Action' => $params['Action'], 'LogTime' => $params['LogTime'] ]); 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/03/25 10:39 */ public static function delete(array $params): bool { return ResourceLogDaodao::destroy($params['Id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2024/03/25 10:39 */ public static function detail($params): array { return ResourceLogDaodao::findOrEmpty($params['Id'])->toArray(); } }