Sellergroup.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 Sellergroup extends BaseModel {
  16. /**
  17. * 读取列表
  18. * @access public
  19. * @author csdeshang
  20. * @param type $condition 条件
  21. * @return type
  22. */
  23. public function getSellergroupList($condition) {
  24. $result = Db::name('sellergroup')->where($condition)->select()->toArray();
  25. return $result;
  26. }
  27. /**
  28. * 读取单条记录
  29. * @access public
  30. * @author csdeshang
  31. * @param type $condition 条件
  32. * @return type
  33. */
  34. public function getSellergroupInfo($condition) {
  35. $result = Db::name('sellergroup')->where($condition)->find();
  36. return $result;
  37. }
  38. /**
  39. * 判断是否存在
  40. * @access public
  41. * @author csdeshang
  42. * @param type $condition 条件
  43. * @return boolean
  44. */
  45. public function isSellergroupExist($condition) {
  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. return Db::name('sellergroup')->insertGetId($data);
  62. }
  63. /**
  64. * 更新
  65. * @access public
  66. * @author csdeshang
  67. * @param array $update 数据
  68. * @param array $condition 条件
  69. * @return bool
  70. */
  71. public function editSellergroup($update, $condition) {
  72. return Db::name('sellergroup')->where($condition)->update($update);
  73. }
  74. /**
  75. * 删除
  76. * @access public
  77. * @author csdeshang
  78. * @param array $condition 条件
  79. * @return bool
  80. */
  81. public function delSellergroup($condition) {
  82. return Db::name('sellergroup')->where($condition)->delete();
  83. }
  84. }