refund.table.php 982 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. class RefundTable extends We7Table {
  8. protected $field = array('uniontid', 'uniacid', 'fee', 'status', 'refund_uniontid', 'reason');
  9. protected $tableName = 'refund';
  10. public function createRefundLog($moduleid, $module_name, $tid, $fee, $reason) {
  11. global $_W;
  12. $refund_uniontid = date('YmdHis') . $moduleid . random(8,1);
  13. $paylog = $this->query->from('core_paylog')->where('uniacid', $_W['uniacid'])->where('tid', $tid)->where('module', $module_name)->get();
  14. $refund = array (
  15. 'uniacid' => $_W['uniacid'],
  16. 'uniontid' => $paylog['uniontid'],
  17. 'fee' => empty($fee) ? $paylog['card_fee'] : $fee,
  18. 'status' => 0,
  19. 'refund_uniontid' => $refund_uniontid,
  20. 'reason' => $reason,
  21. );
  22. pdo_insert('core_refundlog', $refund);
  23. return pdo_insertid();
  24. }
  25. }