Sellerlog.php 2.1 KB

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