Feedback.php 900 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Act\Lib;
  3. use Dever;
  4. class Feedback
  5. {
  6. # 发表反馈
  7. public function submit($uid, $username, $name, $type_id, $contact, $content)
  8. {
  9. $where['uid'] = $uid;
  10. $where['username'] = $username;
  11. $where['name'] = $name;
  12. $where['content'] = $content;
  13. $table = 'act/feedback';
  14. $info = Dever::db($table)->one($where);
  15. if (!$info) {
  16. $where['type_id'] = $type_id;
  17. $where['contact'] = $contact;
  18. $id = Dever::db($table)->insert($where);
  19. } else {
  20. $where['where_id'] = $info['id'];
  21. $where['type_id'] = $type_id;
  22. $where['contact'] = $contact;
  23. Dever::db($table)->update($where);
  24. $id = $info['id'];
  25. }
  26. Dever::score($uid, 'submit_feedback', '发表反馈');
  27. return $id;
  28. }
  29. }