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

支付宝

@@ -375,17 +375,14 @@ class OrderController extends HomeBaseController @@ -375,17 +375,14 @@ class OrderController extends HomeBaseController
375 //欢迎支付宝支付 375 //欢迎支付宝支付
376 private function alipay($oid, $step) 376 private function alipay($oid, $step)
377 { 377 {
  378 + $info = Db::name('order_info')->alias('o')
  379 + ->field('order_sn,status,order_type,a.down_price,s.price,a.name,s.start_time,s.end_time')
  380 + ->join('activity a', 'o.activity_id=a.id')
  381 + ->join('activity_schedule s ', 'o.schedule_id=s.id')
  382 + ->where(['o.id' => $oid])->find();
378 if($step == 1) { 383 if($step == 1) {
379 - $out_trade_no = '2018101210215'.$step;  
380 - $subject = '支付宝支付';  
381 $total_amount = Db::name('order_info')->where(['id'=>$oid])->value('order_amount'); 384 $total_amount = Db::name('order_info')->where(['id'=>$oid])->value('order_amount');
382 - $body = '商品';  
383 }elseif ($step == 2) { 385 }elseif ($step == 2) {
384 - $info = Db::name('order_info')->alias('o')  
385 - ->field('status,order_type,a.down_price,s.price')  
386 - ->join('activity a', 'o.activity_id=a.id')  
387 - ->join('activity_schedule s ', 'o.schedule_id=s.id')  
388 - ->where(['o.id' => $oid])->find();  
389 $num = Db::name('order_detail')->where(['oid' => $oid, 'status' => ['neq', 2]])->count(); 386 $num = Db::name('order_detail')->where(['oid' => $oid, 'status' => ['neq', 2]])->count();
390 if ($info['status'] == 1) { 387 if ($info['status'] == 1) {
391 if ($info['order_type'] == 0) { 388 if ($info['order_type'] == 0) {
@@ -400,10 +397,7 @@ class OrderController extends HomeBaseController @@ -400,10 +397,7 @@ class OrderController extends HomeBaseController
400 } else { 397 } else {
401 $order_amount = 0; 398 $order_amount = 0;
402 } 399 }
403 - $out_trade_no = '2018101210215'.$step;  
404 - $subject = '支付宝支付';  
405 $total_amount = $order_amount; 400 $total_amount = $order_amount;
406 - $body = '商品';  
407 }else { 401 }else {
408 return false; 402 return false;
409 } 403 }
@@ -412,7 +406,9 @@ class OrderController extends HomeBaseController @@ -412,7 +406,9 @@ class OrderController extends HomeBaseController
412 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php'; 406 require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
413 require_once EXTEND_PATH . '/alipay/wappay/buildermodel/AlipayTradeWapPayContentBuilder.php'; 407 require_once EXTEND_PATH . '/alipay/wappay/buildermodel/AlipayTradeWapPayContentBuilder.php';
414 require EXTEND_PATH . '/alipay/config.php'; 408 require EXTEND_PATH . '/alipay/config.php';
415 - 409 + $out_trade_no = $info['order_sn'].$step;
  410 + $subject = '支付宝支付';
  411 + $body = $info['name'].'('.date('Y-m-d', $info['start_time']).')';
416 //超时时间 412 //超时时间
417 $timeout_express = "1m"; 413 $timeout_express = "1m";
418 414