Sellergroup.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Sellergroup extends BaseModel
  15. {
  16. /**
  17. * 读取列表
  18. * @access public
  19. * @author csdeshang
  20. * @param type $condition 条件
  21. * @return type
  22. */
  23. public function getSellergroupList($condition)
  24. {
  25. $result = Db::name('sellergroup')->where($condition)->select()->toArray();
  26. return $result;
  27. }
  28. /**
  29. * 读取单条记录
  30. * @access public
  31. * @author csdeshang
  32. * @param type $condition 条件
  33. * @return type
  34. */
  35. public function getSellergroupInfo($condition)
  36. {
  37. $result = Db::name('sellergroup')->where($condition)->find();
  38. return $result;
  39. }
  40. /**
  41. * 判断是否存在
  42. * @access public
  43. * @author csdeshang
  44. * @param type $condition 条件
  45. * @return boolean
  46. */
  47. public function isSellergroupExist($condition)
  48. {
  49. $result = Db::name('sellergroup')->where($condition)->find();
  50. if (empty($result)) {
  51. return FALSE;
  52. } else {
  53. return TRUE;
  54. }
  55. }
  56. /**
  57. * 增加
  58. * @access public
  59. * @author csdeshang
  60. * @param array $data 参数内容
  61. * @return bool
  62. */
  63. public function addSellergroup($data)
  64. {
  65. return Db::name('sellergroup')->insertGetId($data);
  66. }
  67. /**
  68. * 更新
  69. * @access public
  70. * @author csdeshang
  71. * @param array $update 数据
  72. * @param array $condition 条件
  73. * @return bool
  74. */
  75. public function editSellergroup($update, $condition)
  76. {
  77. return Db::name('sellergroup')->where($condition)->update($update);
  78. }
  79. /**
  80. * 删除
  81. * @access public
  82. * @author csdeshang
  83. * @param array $condition 条件
  84. * @return bool
  85. */
  86. public function delSellergroup($condition)
  87. {
  88. return Db::name('sellergroup')->where($condition)->delete();
  89. }
  90. }