|
@@ -131,7 +131,6 @@ class RefillBase
|
|
|
}
|
|
|
elseif ($can_try)
|
|
|
{
|
|
|
- util::add_exclude_channel($mchid,$mch_order,$card_type,$chname);
|
|
|
util::incr_notify($chname, $card_type, $spec, $quality, false);
|
|
|
util::incr_amount_lock($mchid,$card_type,$spec);
|
|
|
|
|
@@ -161,8 +160,6 @@ class RefillBase
|
|
|
$mod_refill->edit($order_id, ['notify_time' => time(), 'is_retrying' => 0,'notify_state' => 1]);
|
|
|
util::pop_queue_order($mchid,$mch_order);
|
|
|
QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
|
|
|
- util::del_exclude_channel($mchid,$mch_order,$card_type);
|
|
|
-
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -286,6 +283,8 @@ class RefillBase
|
|
|
|
|
|
Log::record("RefillBase::add regin_no={$regin_no}",Log::DEBUG);
|
|
|
[$providers, $overload] = $this->mPolicy->find_providers($mchid, $amount, $card_type, $org_quality, $quality, $regin_no, $pcode, $order_time, $commit_times);
|
|
|
+ $chfilters = new channel_filter($mchid,$mch_order,$quality,$card_type);
|
|
|
+ $providers = $chfilters->getProviders($providers);
|
|
|
|
|
|
if (empty($providers))
|
|
|
{
|
|
@@ -327,21 +326,15 @@ class RefillBase
|
|
|
$refill_state = false;
|
|
|
$order_success = false;
|
|
|
$net_errno = 0;
|
|
|
- $exclude_channels = util::get_exclude_channel($mchid,$mch_order,$card_type);
|
|
|
+
|
|
|
foreach ($providers as $provider)
|
|
|
{
|
|
|
$channel_name = $provider->name();
|
|
|
- if(in_array($channel_name,$exclude_channels)) {
|
|
|
- Log::record("{$channel_name} channel in exclude",Log::DEBUG);
|
|
|
- continue;
|
|
|
- }
|
|
|
|
|
|
- //通道价格大于客户价格,换通道.
|
|
|
[$goods_id, $price] = $provider->goods($quality,$amount,$card_type,$third_params);
|
|
|
if ($goods_id <= 0) continue;
|
|
|
-
|
|
|
if(PolicyUtil::mixed_quality($org_quality) == false && $price > $mch_price) {
|
|
|
- //组合通道,以原始质量算价格.
|
|
|
+ //组合通道,以原始质量算价格. //通道价格大于客户价格,换通道.
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -468,6 +461,7 @@ class RefillBase
|
|
|
|
|
|
if ($state)
|
|
|
{
|
|
|
+ $chfilters->add_channel($channel_name,true);
|
|
|
//提交成功
|
|
|
util::incr_commit($channel_name,$card_type,$amount,$quality,true);
|
|
|
$trade_no = $errmsg;
|
|
@@ -489,6 +483,7 @@ class RefillBase
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ $chfilters->add_channel($channel_name,false);
|
|
|
if(!empty($neterr) && util::need_check($net_errno)) {
|
|
|
$mod_refill->edit($order_id, ['commit_time' => time(),'neterr' => 1,'err_msg' => "neterr={$net_errno}"]);
|
|
|
break;
|
|
@@ -498,7 +493,6 @@ class RefillBase
|
|
|
$commit_times += 1;
|
|
|
util::incr_commit($channel_name,$card_type,$amount,$quality,false);
|
|
|
util::incr_amount_lock($mchid,$card_type,$amount);
|
|
|
- util::add_exclude_channel($mchid,$mch_order,$card_type,$channel_name);
|
|
|
|
|
|
Log::record("channel:{$channel_name} err:{$errmsg}");
|
|
|
$logic_vr_order = Logic("vr_order");
|
|
@@ -679,7 +673,6 @@ class RefillBase
|
|
|
$mod_refill->edit($order_id, ['notify_time' => time(), 'notify_state' => 1]);
|
|
|
util::pop_queue_order($mchid,$mch_order);
|
|
|
QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
|
|
|
- util::del_exclude_channel($mchid,$mch_order,$card_type);
|
|
|
}
|
|
|
else {
|
|
|
QueueClient::async_push("QueryOrderNeterr",['order_id' => $order_id],30);
|