Browse Source

Merge branch 'zhoulj' of iqiyoo:zhuishuyun_wap into stabble

onlinetest 6 years ago
parent
commit
447724e00a

+ 22 - 0
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -137,6 +137,7 @@ class OrdersController extends Controller
         $pay_merchant = DB::table('pay_merchants')->select('id','appid', 'source', 'config_info')->where('id', $channel->pay_merchant_id)->where('is_enabled', 1)->first();
         if (!$pay_merchant || !$pay_merchant->appid || !$pay_merchant->source) return response()->error('WAP_PARAM_ERROR');
         if($pay_merchant->source == 'PALMPAYV2'){
+
             return redirect()->to($this->paympay($request,$pay_merchant));
         }
         //重定向 获取用户信息的次数
@@ -531,6 +532,19 @@ class OrdersController extends Controller
         \Log::info('$wechatPay ok-------------------');
         $pay_info = $wechatPay->send($data);
         \Log::info('send ok-------------------');
+        
+        // 注册动作-》创建订单
+        $action_type = 'CreateOrder';
+        $param = [
+	        'openid' => isset($openid)?$openid:'0',
+	        'uid' =>isset($uid)?$uid:'0',
+	        'order_sn' => isset($trade_no)?$trade_no:'0',
+	        'amount' => isset($price)?$price:'0',
+        ];
+        \Log::info('FUCK_PALMPAYV2');
+        UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
+         
+        
         return $pay_info;
     }
 
@@ -1186,6 +1200,14 @@ class OrdersController extends Controller
                         Log::info('redis remote error-----------------------');
                         Log::info($e);
                     }
+                    
+                    // 注册动作-》回调订单
+                    $action_type = 'CallBackOrder';
+                    $param = [
+	                    'order_sn' => isset($trade_no)?$trade_no:'0',
+	                    'openid' => isset($uid)?$uid:'0',// 没有openid,用uid写log
+                    ];
+                    UserService::PushUserActionToQueue($action_type,$distribution_channel_id,$param);
 
                 }
             } else {

+ 3 - 0
app/Modules/User/Services/UserService.php

@@ -264,12 +264,15 @@ class UserService
     // 扔用户一些动作到队列,异步处理一些额外逻辑
     static function PushUserActionToQueue($action_type,$distribution_channel_id,$param){
     	try{
+//     		\Log::info('PushUserActionToQueue_param_start:'.$distribution_channel_id.' action_type:'.$action_type. ' param:'.json_encode($param));
+    		
     		// 判断站点是否需要额外逻辑
     		$distribution_self_define_config = DistributionSelfDefineConfig::getDistributionSelfDefineConfig($distribution_channel_id,'action_call_ycsd');
     		if(empty($distribution_self_define_config)){
 //     			\Log::info('not_action_call_ycsd:'.$distribution_channel_id);
     			return '';
     		}else{
+    			\Log::info('PushUserActionToQueue_param:'.$distribution_channel_id.' action_type:'.$action_type. ' param:'.json_encode($param));
     			// 如果支付通道已经切换回去,则不推送了
     			$pay_merchant_id = env('YCSD_CALL_PAY_MERCHANT_ID');
     			$channel = Channel::getById($distribution_channel_id);