Vrgroupbuyclass.php 2.2 KB

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