Reply.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. /**
  5. * 欢迎语模型
  6. */
  7. class Reply extends Model
  8. {
  9. /**
  10. * find数据筛选
  11. *
  12. * @access public
  13. * @param mixed $where 数据
  14. * @return array 返回类型
  15. */
  16. public function findReply($where)
  17. {
  18. $result = $this->where($where)->find();
  19. return $result;
  20. }//end findReply()
  21. /**
  22. * select数据筛选
  23. *
  24. * @access public
  25. * @param mixed $where 数据
  26. * @return array 返回类型
  27. */
  28. public function selectReply($where)
  29. {
  30. $result = $this->where($where)->order('sort', 'asc')->select();
  31. return $result;
  32. }//end selectReply()
  33. /**
  34. * 新增数据
  35. *
  36. * @access public
  37. * @param mixed $data 数据
  38. * @return array 返回类型
  39. */
  40. public function addReply($data)
  41. {
  42. $result = $this->insert($data);
  43. return $result;
  44. }//end addReply()
  45. /**
  46. * 删除数据筛选
  47. *
  48. * @access public
  49. * @param mixed $where 条件
  50. * @return array 返回类型
  51. */
  52. public function delReply($where)
  53. {
  54. $result = $this->where($where)->delete();
  55. return $result;
  56. }//end delReply()
  57. /**
  58. * 数据修改
  59. *
  60. * @access public
  61. * @param mixed $data 数据
  62. * @param mixed $where 条件
  63. * @return array 返回类型
  64. */
  65. public function updateReply($where, $data)
  66. {
  67. $result = $this->where($where)->update($data);
  68. return $result;
  69. }//end updateReply()
  70. }