Memberbank.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 数据层模型
  13. */
  14. class Memberbank extends BaseModel {
  15. /**
  16. * 取得单条提现账户
  17. * @author csdeshang
  18. * @param array $condition 条件
  19. * @param type $order 排序
  20. * @return string
  21. */
  22. public function getMemberbankInfo($condition, $order = '') {
  23. $addr_info = Db::name('memberbank')->where($condition)->order($order)->find();
  24. return $addr_info;
  25. }
  26. /**
  27. * 读取提现账户列表
  28. * @author csdeshang
  29. * @param array $condition 查询条件
  30. * @param type $order 排序
  31. * @return array 数组格式的返回结果
  32. */
  33. public function getMemberbankList($condition, $order = 'memberbank_id desc') {
  34. $memberbank_list = Db::name('memberbank')->where($condition)->order($order)->select()->toArray();
  35. return $memberbank_list;
  36. }
  37. /**
  38. * 取数量
  39. * @author csdeshang
  40. * @param array $condition 条件
  41. * @return int
  42. */
  43. public function getMemberbankCount($condition = array()) {
  44. return Db::name('memberbank')->where($condition)->count();
  45. }
  46. /**
  47. * 新增提现账户
  48. * @author csdeshang
  49. * @param array $data 参数内容
  50. * @return bool 布尔类型的返回结果
  51. */
  52. public function addMemberbank($data) {
  53. return Db::name('memberbank')->insertGetId($data);
  54. }
  55. /**
  56. * 取单个提现账户
  57. * @author csdeshang
  58. * @param int $id 提现账户ID
  59. * @return array 数组类型的返回结果
  60. */
  61. public function getOneMemberbank($id) {
  62. if (intval($id) > 0) {
  63. $result = Db::name('memberbank')->where('memberbank_id',intval($id))->find();
  64. return $result;
  65. } else {
  66. return false;
  67. }
  68. }
  69. /**
  70. * 更新提现账户
  71. * @author csdeshang
  72. * @param array $update 更新数据
  73. * @param array $condition 更新条件
  74. * @return bool 布尔类型的返回结果
  75. */
  76. public function editMemberbank($update, $condition) {
  77. return Db::name('memberbank')->where($condition)->update($update);
  78. }
  79. /**
  80. * 删除提现账户
  81. * @author csdeshang
  82. * @param array $condition记录ID
  83. * @return bool 布尔类型的返回结果
  84. */
  85. public function delMemberbank($condition) {
  86. return Db::name('memberbank')->where($condition)->delete();
  87. }
  88. }