Просмотр исходного кода

Wesmiler 人人车 初始化项目 0816

APPLE 3 лет назад
Родитель
Сommit
1b149ad4dc

+ 8 - 6
application/api/controller/v1/Taxi.php

@@ -360,6 +360,8 @@ class Taxi extends ApiController
                 $taxiUid = isset($row['taxi_uid'])? $row['taxi_uid'] : 0;
                 $createTime = isset($row['created_at'])? $row['created_at'] : 0;
                 $cancelTime = isset($config['store']['store_cancel_time'])? $config['store']['store_cancel_time'] : 0;
+                $taxiUser = model('common/TaxiUser')->where(['id'=> $taxiUid])->find();
+                $taxiUserId = isset($taxiUser['user_id'])? $taxiUser['user_id'] : 0;
                 if ($row['status'] == 3 ) {
                     // 免费取消时间内不扣除
                     if($cancelTime<=0 || $createTime < (time() - $cancelTime*60)){
@@ -376,9 +378,9 @@ class Taxi extends ApiController
                     );
 
                     // 退款扣除金额直接给司机
-                    if($taxiUid && $cost_price>0){
+                    if($taxiUserId && $cost_price>0){
                         model('common/Users')->changeBalance(
-                            $taxiUid,
+                            $taxiUserId,
                             $cost_price,
                             "取消成功,扣除用户金额到账【" . $cost_price . "】",
                             true
@@ -393,9 +395,9 @@ class Taxi extends ApiController
                     );
 
                     // 退款扣除金额直接给司机
-                    if($taxiUid && $cost_price>0){
+                    if($taxiUserId && $cost_price>0){
                         model('common/Users')->changeBalance(
-                            $taxiUid,
+                            $taxiUserId,
                             $cost_price,
                             "取消成功,扣除用户金额到账【" . $cost_price . "】",
                             true
@@ -431,9 +433,9 @@ class Taxi extends ApiController
                     }
                     else {
                         // 退款扣除金额直接给司机
-                        if($taxiUid && $cost_price>0){
+                        if($taxiUserId && $cost_price>0){
                             model('common/Users')->changeBalance(
-                                $taxiUid,
+                                $taxiUserId,
                                 $cost_price,
                                 "取消成功,扣除用户金额到账【" . $cost_price . "】",
                                 true

+ 1 - 0
application/api/controller/v1/Wechat.php

@@ -758,6 +758,7 @@ class Wechat extends ApiController
     
         // 检查用户余额
         $user = $this->auth->user();
+        var_dump($user);
         if ($user[$payType] < $paylog['total_price']) {
             return $this->ApiJson(-1, '支付失败,账户余额不足!');
         }