Feedback.php 1.5 KB

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