💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 日志管理 主要管理后台用户的行为操作,如登录、添加、删除等 > 有待完善 ### 具体代码模块 /application/extra/function.php ~~~ /** * 记录日志 * @param [type] $uid [用户id] * @param [type] $username [用户名] * @param [type] $description [描述] * @param [type] $status [状态] * @param [type] $tag [标签] * @param [type] $act [操作] * @return [type] [description] */ function writelog($item_id,$tag='',$act='',$uid,$uname,$description,$status=1) { $data['item_id'] = $item_id; $data['uid'] = $uid; $data['uname'] = $uname; $data['description'] = $description; $data['status'] = $status; $data['tag'] = $tag; $data['act'] = $act; $data['ip'] = request()->ip(); $data['create_time'] = time(); $log = Db::name('Log')->insert($data); } ~~~ ~~~ function writelog_admin($tag,$act,$description,$status=1){ $data['item_id'] = session('item_id'); $data['uid'] = session('uid'); $data['uname'] = session('username'); $data['description'] = $description; $data['status'] = $status; $data['tag'] = $tag; $data['act'] = $act; $data['ip'] = request()->ip(); $data['create_time'] = time(); $log = Db::name('Log')->insert($data); } ~~~ `writelog_admin('admin','login','后台登录成功');` `writelog_admin('admin','managefee','物业管理费缴费');`