Sellergroup.php 2.1 KB

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