Storereopen.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Storereopen 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. * @return array
  25. */
  26. public function getStorereopenList($condition = array(), $pagesize = '', $order = 'storereopen_id desc') {
  27. if($pagesize){
  28. $result = Db::name('storereopen')->where($condition)->order($order)->paginate(['list_rows'=>$pagesize,'query' => request()->param()],false);
  29. $this->page_info = $result;
  30. return $result->items();
  31. }else{
  32. return Db::name('storereopen')->where($condition)->order($order)->select()->toArray();
  33. }
  34. }
  35. /**
  36. * 增加新记录
  37. * @access public
  38. * @author csdeshang
  39. * @param arrat $data 参数内容
  40. * @return bool
  41. */
  42. public function addStorereopen($data) {
  43. return Db::name('storereopen')->insertGetId($data);
  44. }
  45. /**
  46. * 取单条信息
  47. * @access public
  48. * @author csdeshang
  49. * @param type $condition 条件
  50. * @return type
  51. */
  52. public function getStorereopenInfo($condition) {
  53. return Db::name('storereopen')->where($condition)->find();
  54. }
  55. /**更新记录
  56. * @access public
  57. * @author csdeshang
  58. * @param type $data 更新数据
  59. * @param type $condition 条件
  60. * @return type
  61. */
  62. public function editStorereopen($data, $condition) {
  63. return Db::name('storereopen')->where($condition)->update($data);
  64. }
  65. /**
  66. * 取得数量
  67. * @access public
  68. * @author csdeshang
  69. * @param array $condition 条件
  70. * @return int
  71. */
  72. public function getStorereopenCount($condition) {
  73. return Db::name('storereopen')->where($condition)->count();
  74. }
  75. /**
  76. * 删除记录
  77. * @access public
  78. * @author csdeshang
  79. * @param array $condition 条件
  80. * @return bool
  81. */
  82. public function delStorereopen($condition) {
  83. return Db::name('storereopen')->where($condition)->delete();
  84. }
  85. }
  86. ?>