Complaintalk.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Complaintalk extends BaseModel
  12. {
  13. /**
  14. * 增加
  15. * @access public
  16. * @author csdeshang
  17. * @param array $data 参数内容
  18. * @return bool
  19. */
  20. public function addComplaintalk($data)
  21. {
  22. return Db::name('complaintalk')->insertGetId($data);
  23. }
  24. /**
  25. * 更新
  26. * @access public
  27. * @author csdeshang
  28. * @param array $update_array 更新数据
  29. * @param array $condition 更新条件
  30. * @return bool
  31. */
  32. public function editComplaintalk($update_array, $condition)
  33. {
  34. return Db::name('complaintalk')->where($condition)->update($update_array);
  35. }
  36. /**
  37. * 删除投诉用语
  38. * @access public
  39. * @author csdeshang
  40. * @param array $condition 检索条件
  41. * @return bool
  42. */
  43. public function delComplaintalk($condition)
  44. {
  45. return Db::name('complaintalk')->where($condition)->delete();
  46. }
  47. /**
  48. * 获得列表
  49. * @param array $condition 检索条件
  50. * @param str $field 字段
  51. * @param str $order 排序
  52. * @return array
  53. */
  54. public function getComplaintalkList($condition = '', $field = '*', $order = 'talk_id desc ')
  55. {
  56. return Db::name('complaintalk')->where($condition)->field($field)->order($order)->select()->toArray();
  57. }
  58. }