Vrgroupbuyclass.php 2.0 KB

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