如何使用 PHP 构建支持票系统?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3146895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:50:58  来源:igfitidea点击:

How can I build a support ticket system with PHP?

phpmysqlticket-systemticket-tracking

提问by Derek

I have a custom and simple php/mysqlbased user system. I'm trying to build a way for members to send product support to our staff (put it in a database & viewed in admin area) and for them to manage these messages.

我有一个自定义且简单的基于php/ mysql的用户系统。我正在尝试建立一种方式,让会员向我们的员工发送产品支持(将其放入数据库并在管理区域中查看)并让他们管理这些消息。

Does anyone know of a good existing script, or a better approach for a support area of my website?

有谁知道一个好的现有脚本,或者我网站支持区域的更好方法?

回答by Luke

Ticketing systems are a pretty easy build, have a database table:

票务系统是一个非常简单的构建,有一个数据库表:

tickets
id int(11)
user_id int(11)
message text
is_active tinyint(1)
created_at datetime
time_spent int(5) //unless your going to spend more than 99999 mins on a ticket

Now each time a user creates a ticket it goes into the db as VALUES(id,'$user_id','$message',0,NOW(),0)//remember to clean the vars

现在,每次用户创建票证时,它都会作为 VALUES(id,'$user_id','$message',0,NOW(),0)//remember to clean the vars

Admin can complete a ticket, update the field so that is_active = 1, then request time spent from the admin and update time_spent = '$time_spent'

管理员可以完成工单,更新字段使 is_active = 1,然后向管理员请求花费的时间并更新 time_spent = '$time_spent'

You could add a commenting system simply

您可以简单地添加评论系统

Database table: comments
id int(11)
ticket_id int(11)
user_id int(11)
comment text
created_at datetime

This way you can have unlimited(up to a total total of 99999999999) comments per ticket and you track the user id so you can put names next to each comment.

通过这种方式,您可以对每张票有无限的评论(最多总共 99999999999 条),并且您可以跟踪用户 ID,以便您可以在每条评论旁边放置名称。

You can call the comments using

您可以使用

select * from comments where ticket_id = $id //the current tickets id

select * from comments where ticket_id = $id //the current tickets id

I hope this helps, its a nice easy build and means you know exactly how it works, its always nice to have done it yourself and its easily customisable.

我希望这会有所帮助,它是一个很好的简单构建,意味着您确切地知道它是如何工作的,自己完成它总是很好,并且它很容易定制。

Regards Luke

问候卢克

回答by Casey

You could use osTicketwhich is open source and free.

您可以使用开源且免费的osTicket

回答by Stephen C

Or use Spiceworks. It's free.

或者使用 Spiceworks。免费。