MemberWithdrawStat.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace app\model\stat;
  11. use app\model\BaseModel;
  12. use app\model\system\Stat;
  13. use think\facade\Log;
  14. /**
  15. * 会员提现统计
  16. * @author Administrator
  17. *
  18. */
  19. class MemberWithdrawStat extends BaseModel
  20. {
  21. /**
  22. * 用于会员提现
  23. * @param $params
  24. */
  25. public function addMemberWithdrawStat($params)
  26. {
  27. $id = $params[ 'id' ];
  28. $site_id = $params[ 'site_id' ] ?? 0;
  29. $condition = array (
  30. [ 'id', '=', $id ],
  31. [ 'site_id', '=', $site_id ]
  32. );
  33. $info = model('member_withdraw')->getInfo($condition);
  34. if (empty($info))
  35. return $this->error();
  36. $member_withdraw_total_money = $info[ 'apply_money' ];
  37. $stat_data = array (
  38. 'site_id' => $site_id,
  39. 'member_withdraw_count' => 1,
  40. 'member_withdraw_total_money' => $member_withdraw_total_money
  41. );
  42. $stat_model = new Stat();
  43. Log::write('addMemberWithdrawStat' . json_encode($stat_data));
  44. $result = $stat_model->addShopStat($stat_data);
  45. return $result;
  46. }
  47. }