ShopDeposit.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com.cn
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
  9. * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
  10. * =========================================================
  11. */
  12. namespace app\model\shop;
  13. use app\model\BaseModel;
  14. /**
  15. * 店铺保证金(预存款)
  16. */
  17. class ShopDeposit extends BaseModel
  18. {
  19. /**
  20. * 添加保证金(不考虑审核情况)
  21. * @param unknown $data
  22. */
  23. public function addDeposit($data)
  24. {
  25. $res = model("shop_deposit")->add($data);
  26. return $this->success($res);
  27. }
  28. /**
  29. * 修改保证金(不考虑审核)
  30. * @param array $data
  31. * @param array $condition
  32. */
  33. public function editDeposit($data, $condition)
  34. {
  35. $res = model('shop_deposit')->update($data, $condition);
  36. return $this->success($res);
  37. }
  38. /**
  39. * 审核通过保证金
  40. * @param unknown $id
  41. * @param unknown $site_id
  42. */
  43. public function auditDeposit($id, $site_id)
  44. {
  45. $shop_deposit = model('shop_deposit')->getInfo([['id', '=', $id], ['site_id', '=', $site_id]], 'money');
  46. $res = model('shop_deposit')->update(['status' => 1, 'audit_time' => time()], [['id', '=', $id], ['site_id', '=', $site_id]]);
  47. if($res)
  48. {
  49. //修改店铺保证金字段
  50. model("shop")->setInc([['site_id', '=', $site_id]], 'shop_baozhrmb', $shop_deposit['money']);
  51. }
  52. return $this->success($res);
  53. }
  54. /**
  55. * 获取店铺保证金信息
  56. * @param unknown $condition
  57. * @param string $field
  58. */
  59. public function getShopDepositInfo($condition, $field = '*')
  60. {
  61. $res = model('shop_deposit')->getInfo( $condition, $field);
  62. return $this->success($res);
  63. }
  64. /**
  65. * 获取店铺保证金列表
  66. * @param array $condition
  67. * @param string $field
  68. * @param string $order
  69. * @param string $limit
  70. */
  71. public function getShopDepositList($condition = [], $field = '*', $order = '', $limit = null)
  72. {
  73. $list = model('shop_deposit')->getList($condition, $field, $order, '', '', '', $limit);
  74. return $this->success($list);
  75. }
  76. /**
  77. * 获取店铺保证金分页列表
  78. * @param array $condition
  79. * @param number $page
  80. * @param string $page_size
  81. * @param string $order
  82. * @param string $field
  83. */
  84. public function getShopDepositPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*')
  85. {
  86. $list = model('shop_deposit')->pageList($condition, $field, $order, $page, $page_size);
  87. return $this->success($list);
  88. }
  89. }