Pay.php 772 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace Product\Lib;
  3. use Dever;
  4. class Pay
  5. {
  6. /**
  7. * 支付成功后,调取的接口
  8. *
  9. * @return mixed
  10. */
  11. public function act($param)
  12. {
  13. $product_id = $param['pay_product_id'];
  14. $uid = $param['pay_uid'];
  15. $cash = $param['pay_cash'];
  16. $order_id = $param['pay_order_id'];
  17. $status = $param['pay_status'];
  18. $msg = $param['pay_msg'];
  19. $order = Dever::db('product/order')->one(array('order_id' => $order_id, 'uid' => $uid));
  20. if ($status == 2 && $order) {
  21. Dever::db('product/order')->update(array('where_id' => $order['id'], 'status' => 2));
  22. } else {
  23. Dever::db('product/order')->update(array('where_id' => $order['id'], 'status' => 3));
  24. }
  25. }
  26. }