Pay.php 938 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Service\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. if ($status == 2) {
  20. # 支付成功
  21. //$order_id = 'WX' . $order_id;
  22. $product = Dever::db('service/product')->one($product_id);
  23. if ($product) {
  24. $order = Dever::db('service/order')->one(array('product_id' => $product_id, 'order_id' => $order_id, 'uid' => $uid));
  25. if ($order) {
  26. Dever::db('service/order')->update(array('where_id' => $order['id'], 'status' => 2));
  27. }
  28. }
  29. }
  30. }
  31. }