Groupbuypricerange.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. * DSMall多用户商城
  7. * ============================================================================
  8. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  9. * 网站地址: http://www.csdeshang.com
  10. * ----------------------------------------------------------------------------
  11. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  12. * 不允许对程序代码以任何形式任何目的的再发布。
  13. * ============================================================================
  14. * 数据层模型
  15. */
  16. class Groupbuypricerange extends BaseModel
  17. {
  18. public $page_info;
  19. /**
  20. * 读取列表
  21. * @access public
  22. * @author csdeshang
  23. * @param array $condition 条件
  24. * @param int $pagesize 分页
  25. * @param string $order 排序
  26. * @return array
  27. */
  28. public function getGroupbuypricerangeList($condition = array(), $pagesize = '',$order='gprange_id desc')
  29. {
  30. if ($pagesize) {
  31. $res = Db::name('groupbuypricerange')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  32. $this->page_info = $res;
  33. return $res->items();
  34. }else{
  35. return Db::name('groupbuypricerange')->where($condition)->order($order)->select()->toArray();
  36. }
  37. }
  38. /**
  39. * 根据编号获取单个内容
  40. * @access public
  41. * @author csdeshang
  42. * @param int $id 主键编号
  43. * @return array 数组类型的返回结果
  44. */
  45. public function getOneGroupbuypricerange($id) {
  46. $result = Db::name('groupbuypricerange')->where('gprange_id',intval($id))->find();
  47. return $result;
  48. }
  49. /**
  50. * 判断是否存在
  51. * @access public
  52. * @author csdeshang
  53. * @param type $condition 条件
  54. * @return bool
  55. */
  56. public function isGroupbuypricerangeExist($condition = '')
  57. {
  58. $list = Db::name('groupbuypricerange')->where($condition)->select()->toArray();
  59. return $list;
  60. }
  61. /**
  62. * 增加
  63. * @access public
  64. * @author csdeshang
  65. * @param array $data 参数内容
  66. * @return bool
  67. */
  68. public function addGroupbuypricerange($data)
  69. {
  70. return Db::name('groupbuypricerange')->insertGetId($data);
  71. }
  72. /**
  73. * 更新
  74. * @param array $update_array 更新数据
  75. * @param array $where_array 更新条件
  76. * @return bool
  77. */
  78. public function editGroupbuypricerange($update_array, $where_array)
  79. {
  80. return Db::name('groupbuypricerange')->where($where_array)->update($update_array);
  81. }
  82. /**
  83. * 删除
  84. * @access public
  85. * @author csdeshang
  86. * @param array $condition 检索条件
  87. * @return bool
  88. */
  89. public function delGroupbuypricerange($condition)
  90. {
  91. return Db::name('groupbuypricerange')->where($condition)->delete();
  92. }
  93. }