|
@@ -270,7 +270,7 @@ class OrdersController extends Controller
|
|
}
|
|
}
|
|
$from_bid = ReadRecordService::getSimpleFirstReadRecord($uid);
|
|
$from_bid = ReadRecordService::getSimpleFirstReadRecord($uid);
|
|
$inner_send_order_id = ReadRecordService::getInnerSendOrderId($uid);
|
|
$inner_send_order_id = ReadRecordService::getInnerSendOrderId($uid);
|
|
- $result = $this->createUnPayOrder([
|
|
|
|
|
|
+ $init_order = [
|
|
'distribution_channel_id' => $distribution_channel_id,
|
|
'distribution_channel_id' => $distribution_channel_id,
|
|
'uid' => $uid,
|
|
'uid' => $uid,
|
|
'product_id' => $product_id,
|
|
'product_id' => $product_id,
|
|
@@ -287,7 +287,14 @@ class OrdersController extends Controller
|
|
'from_type' => $fromtype,
|
|
'from_type' => $fromtype,
|
|
'activity_id' => $activity_id,
|
|
'activity_id' => $activity_id,
|
|
'inner_send_order_id'=>$inner_send_order_id
|
|
'inner_send_order_id'=>$inner_send_order_id
|
|
- ]);
|
|
|
|
|
|
+ ];
|
|
|
|
+ $result = $this->createUnPayOrder($init_order);
|
|
|
|
+
|
|
|
|
+ //订单创建成功后增加统计
|
|
|
|
+ if($result)
|
|
|
|
+ {
|
|
|
|
+ $this->orderCreated($init_order);
|
|
|
|
+ }
|
|
|
|
|
|
if ($request->get('suid')) {
|
|
if ($request->get('suid')) {
|
|
$this->createSubstituteOrder($result->id, $uid, $request->get('suid'));
|
|
$this->createSubstituteOrder($result->id, $uid, $request->get('suid'));
|
|
@@ -357,6 +364,40 @@ class OrdersController extends Controller
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //订单创建后统计
|
|
|
|
+ private function orderCreated($init_order)
|
|
|
|
+ {
|
|
|
|
+ try {
|
|
|
|
+ if(isset($init_order['pay_merchant_id']))
|
|
|
|
+ {
|
|
|
|
+ $key = 'pay_merchant:'.$init_order['pay_merchant_id'];
|
|
|
|
+ Redis::hincrby($key,'unpaid_num',1);
|
|
|
|
+ Redis::hset($key,'last_create_time', time());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }catch (\Exception $e)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //订单回调后统计
|
|
|
|
+ private function orderPaid($init_order)
|
|
|
|
+ {
|
|
|
|
+ try {
|
|
|
|
+ if(isset($init_order['pay_merchant_id']))
|
|
|
|
+ {
|
|
|
|
+ $key = 'pay_merchant:'.$init_order['pay_merchant_id'];
|
|
|
|
+ Redis::hset($key,'unpaid_num',0);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }catch (\Exception $e)
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public function reportError(Request $request)
|
|
public function reportError(Request $request)
|
|
{
|
|
{
|
|
$data = $request->post('data');
|
|
$data = $request->post('data');
|
|
@@ -1191,6 +1232,12 @@ class OrdersController extends Controller
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(isset($order->pay_merchant_id) && $order->pay_merchant_id)//临时统计队列清0 用于报警
|
|
|
|
+ {
|
|
|
|
+ $key = 'pay_merchant:'.$order->pay_merchant_id;
|
|
|
|
+ Redis::hset($key,'unpaid_num',0);
|
|
|
|
+ }
|
|
}catch (\Exception $e){}
|
|
}catch (\Exception $e){}
|
|
|
|
|
|
}
|
|
}
|