Sellerlog.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 数据层模型
  14. */
  15. class Sellerlog extends BaseModel {
  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. if($pagesize){
  29. $result = Db::name('sellerlog')->field($field)->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  30. $this->page_info = $result;
  31. return $result->items();
  32. }else{
  33. $result = Db::name('sellerlog')->field($field)->where($condition)->order($order)->select()->toArray();
  34. return $result;
  35. }
  36. }
  37. /**
  38. * 读取单条记录
  39. * @access public
  40. * @author csdeshang
  41. * @param type $condition 条件
  42. * @return type
  43. */
  44. public function getSellerlogInfo($condition) {
  45. $result = Db::name('sellerlog')->where($condition)->find();
  46. return $result;
  47. }
  48. /**
  49. * 增加
  50. * @access public
  51. * @author csdeshang
  52. * @param array $data 数据
  53. * @return bool
  54. */
  55. public function addSellerlog($data) {
  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. return Db::name('sellerlog')->where($condition)->delete();
  67. }
  68. }