Vrgroupbuyclass.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 Vrgroupbuyclass extends BaseModel
  16. {
  17. /**
  18. * 线下分类信息
  19. * @access public
  20. * @author csdeshang
  21. * @param array $condition 条件
  22. * @param string $field 字段
  23. * @return array
  24. */
  25. public function getVrgroupbuyclassInfo($condition, $field = '*')
  26. {
  27. return Db::name('vrgroupbuyclass')->field($field)->where($condition)->find();
  28. }
  29. /**
  30. * 线下分类列表
  31. * @access public
  32. * @author csdeshang
  33. * @param array $condition 条件
  34. * @param str $field 字段
  35. * @param str $order 排序
  36. * @param int $limit 限制
  37. * @return array
  38. */
  39. public function getVrgroupbuyclassList($condition = array(), $field = '*', $order = 'vrgclass_sort', $limit = 1000)
  40. {
  41. return Db::name('vrgroupbuyclass')->where($condition)->order($order)->limit($limit)->select()->toArray();
  42. }
  43. /**
  44. * 添加线下分类
  45. * @access public
  46. * @author csdeshang
  47. * @param array $data 数据
  48. * @return type
  49. */
  50. public function addVrgroupbuyclass($data)
  51. {
  52. return Db::name('vrgroupbuyclass')->insertGetId($data);
  53. }
  54. /**
  55. * 编辑线下分类
  56. * @access public
  57. * @author csdeshang
  58. * @param type $condition 条件
  59. * @param type $data 更新数据
  60. * @return type
  61. */
  62. public function editVrgroupbuyclass($condition, $data)
  63. {
  64. return Db::name('vrgroupbuyclass')->where($condition)->update($data);
  65. }
  66. /**
  67. * 删除线下分类
  68. * @access public
  69. * @author csdeshang
  70. * @param type $condition 条件
  71. * @return bool
  72. */
  73. public function delVrgroupbuyclass($condition)
  74. {
  75. return Db::name('vrgroupbuyclass')->where($condition)->delete();
  76. }
  77. }