zz 6 gadi atpakaļ
vecāks
revīzija
82dcefd1a8
1 mainītis faili ar 10 papildinājumiem un 4 dzēšanām
  1. 10 4
      app/Http/Controllers/Wap/Pay/OrdersController.php

+ 10 - 4
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -73,7 +73,7 @@ class OrdersController extends Controller
         $activity_id = $request->has('activity_id') ? $request->get('activity_id') : 0;
         $ip = $request->has('ip') ? $request->get('ip') : '';
         $n = $request->has('n') ? $request->get('n') : 0;
-        $crp = $request->has('crp') ? $request->get('crp') : 0;
+        $crm = $request->has('crm') ? $request->get('crm') : 0;
 
         if ($send_order_id && strlen($send_order_id) > 50) {
             try {
@@ -168,7 +168,7 @@ class OrdersController extends Controller
                 $ip = get_client_ip();
             }
 
-            $params = compact('uid', 'product_id', 'distribution_channel_id', 'send_order_id', 'bid', 'trade_no', 'pay_redirect_url', 'fromtype', 'activity_id', 'n', 'suid', 'ip', 'p_channel_id','crp');
+            $params = compact('uid', 'product_id', 'distribution_channel_id', 'send_order_id', 'bid', 'trade_no', 'pay_redirect_url', 'fromtype', 'activity_id', 'n', 'suid', 'ip', 'p_channel_id','crm');
 
             $redirect_url = env('CREATE_PAY_URL') . '?' . http_build_query($params);
             //$redirect_url  = env('CREATE_PAY_URL').'?uid='.$uid.'&product_id='.$product_id.'&distribution_channel_id='
@@ -323,9 +323,9 @@ class OrdersController extends Controller
                     'order_id'=>$result->id,'gxhp'=>'mw_transfer','appid'=>'','bid'=>$bid,'data_hour_key'=>'','times'=>'','distribution_channel_id'=>$p_channel_id
                 ]);
             }
-            if($crp){
+            if($crm){
                 OrderParamService::createByParam([
-                    'order_id'=>$result->id,'gxhp'=>'crm','appid'=>'','bid'=>$bid,'data_hour_key'=>$crp,'times'=>'','distribution_channel_id'=>$distribution_channel_id
+                    'order_id'=>$result->id,'gxhp'=>'crm','appid'=>'','bid'=>$bid,'data_hour_key'=>$crm,'times'=>'','distribution_channel_id'=>$distribution_channel_id
                 ]);
             }
         }
@@ -415,6 +415,7 @@ class OrdersController extends Controller
         $activity_id = $request->get('activity_id', 0);
         $suid = $request->get('suid', 0);
         $bid = $request->has('bid') ? $request->get('bid') : 0;
+        $crm = $request->has('crm') ? $request->get('crm') : '';
         $hash_bid = $bid;
         $fromtype = $request->has('fromtype') ? $request->get('fromtype') : $request->get('from', 'main');
 
@@ -526,6 +527,11 @@ class OrdersController extends Controller
         if ($result) {
             $this->orderCreated($init_order);
             $this->recordOtherParam($result->id, $uid);
+            if($crm){
+                OrderParamService::createByParam([
+                    'order_id'=>$result->id,'gxhp'=>'crm','appid'=>'','bid'=>$bid,'data_hour_key'=>$crm,'times'=>'','distribution_channel_id'=>$distribution_channel_id
+                ]);
+            }
         }
         if ($suid) {
             $this->createSubstituteOrder($result->id, $uid, $suid);