作者 lihan
1 个管道 的构建 通过 耗费 0 秒

赠送优惠券

@@ -344,7 +344,11 @@ class OrderController extends HomeBaseController @@ -344,7 +344,11 @@ class OrderController extends HomeBaseController
344 public function notify() 344 public function notify()
345 { 345 {
346 $pay = new \Payment(); 346 $pay = new \Payment();
347 - $pay->handleNotify(); 347 + $return = $pay->handleNotify();
  348 + if(!empty($return)) {
  349 + $order = new OrderModel;
  350 + $order->orderCallBack($return['attach'], $return['total_fee']);
  351 + }
348 } 352 }
349 353
350 } 354 }
@@ -56,7 +56,7 @@ class OrderModel extends Model @@ -56,7 +56,7 @@ class OrderModel extends Model
56 $wallet = [ 56 $wallet = [
57 'user_id' => $orderInfo['user_id'], 57 'user_id' => $orderInfo['user_id'],
58 'type' => 0, 58 'type' => 0,
59 - 'cost' => $orderInfo['order_amount'], 59 + 'cost' => $amount,
60 'create_time' => time() 60 'create_time' => time()
61 ]; 61 ];
62 if (Db::name('my_wallet')->insert($wallet)) { 62 if (Db::name('my_wallet')->insert($wallet)) {
@@ -108,6 +108,10 @@ class OrderModel extends Model @@ -108,6 +108,10 @@ class OrderModel extends Model
108 } 108 }
109 if ($go == 'commit') { 109 if ($go == 'commit') {
110 Db::commit(); 110 Db::commit();
  111 + if($orderInfo['payment'] == 1) {
  112 + echo "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
  113 + exit();
  114 + }
111 return true; 115 return true;
112 } else { 116 } else {
113 Db::rollback(); 117 Db::rollback();