Sellerlog.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Sellerlog 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. * @param string $field 字段
  22. * @return array
  23. */
  24. public function getSellerlogList($condition, $pagesize = '', $order = '', $field = '*')
  25. {
  26. if ($pagesize) {
  27. $result = Db::name('sellerlog')->field($field)->where($condition)->order($order)->paginate(['list_rows' => $pagesize, 'query' => request()->param()], false);
  28. $this->page_info = $result;
  29. return $result->items();
  30. } else {
  31. $result = Db::name('sellerlog')->field($field)->where($condition)->order($order)->select()->toArray();
  32. return $result;
  33. }
  34. }
  35. /**
  36. * 读取单条记录
  37. * @access public
  38. * @author csdeshang
  39. * @param type $condition 条件
  40. * @return type
  41. */
  42. public function getSellerlogInfo($condition)
  43. {
  44. $result = Db::name('sellerlog')->where($condition)->find();
  45. return $result;
  46. }
  47. /**
  48. * 增加
  49. * @access public
  50. * @author csdeshang
  51. * @param array $data 数据
  52. * @return bool
  53. */
  54. public function addSellerlog($data)
  55. {
  56. return Db::name('sellerlog')->insertGetId($data);
  57. }
  58. /**
  59. * 删除
  60. * @access public
  61. * @author csdeshang
  62. * @param array $condition 条件
  63. * @return bool
  64. */
  65. public function delSellerlog($condition)
  66. {
  67. return Db::name('sellerlog')->where($condition)->delete();
  68. }
  69. }