Complaintalk.php 1.8 KB

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