Feedback.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Feedback extends BaseModel
  12. {
  13. public $page_info;
  14. /**
  15. * 列表
  16. * @access public
  17. * @author csdeshang
  18. * @param array $condition 查询条件
  19. * @param int $pagesize 分页数
  20. * @param string $order 排序
  21. * @return array
  22. */
  23. public function getFeedbackList($condition, $pagesize = 10, $order = 'fb_id desc')
  24. {
  25. $list = Db::name('feedback')->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
  26. $this->page_info = $list;
  27. return $list;
  28. }
  29. /**
  30. * 新增
  31. * @access public
  32. * @author csdeshang
  33. * @param array $data 参数内容
  34. * @return bool 布尔类型的返回结果
  35. */
  36. public function addFeedback($data)
  37. {
  38. return Db::name('feedback')->insertGetId($data);
  39. }
  40. /**
  41. * 删除
  42. * @access public
  43. * @author csdeshang
  44. * @param int $condition 条件
  45. * @return bool 布尔类型的返回结果
  46. */
  47. public function delFeedback($condition)
  48. {
  49. return Db::name('feedback')->where($condition)->delete();
  50. }
  51. }