|
@@ -10,19 +10,20 @@ class proxy
|
|
|
{
|
|
|
private function onEerror(refill\order $order,$need_callback,$errmsg)
|
|
|
{
|
|
|
- $refill_order = Model('refill_order');
|
|
|
+ $mod_refill = Model('refill_order');
|
|
|
$mchid = $order->mchid();
|
|
|
$mch_order = $order->mch_order();
|
|
|
$last_order_id = $order->last_order_id();
|
|
|
+ $order_time = $order->order_time();
|
|
|
|
|
|
if ($last_order_id === 0) {
|
|
|
$order_id = refill\RefillFactory::instance()->zero_order($order, $errmsg);
|
|
|
$last_order_id = $order_id;
|
|
|
} else {
|
|
|
- $refill_order->edit($last_order_id, ['notify_time' => time(), 'notify_state' => 1, 'is_retrying' => 0]);
|
|
|
+ $mod_refill->partition(util::part_refill($order_time))->edit($last_order_id, ['notify_time' => time(), 'notify_state' => 1, 'is_retrying' => 0]);
|
|
|
}
|
|
|
|
|
|
- refill\util::pop_queue_order($mchid, $mch_order);
|
|
|
+ refill\util::pop_queue_order($mchid, $mch_order,$order_time);
|
|
|
QueueClient::push("NotifyMerchantComplete", ['order_id' => $last_order_id, 'manual' => false]);
|
|
|
|
|
|
if($need_callback)
|
|
@@ -100,7 +101,7 @@ class proxy
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- refill\util::pop_queue_order($mchid, $mch_order);
|
|
|
+ refill\util::pop_queue_order($mchid, $mch_order, $order->order_time());
|
|
|
QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => false]);
|
|
|
|
|
|
return true;
|
|
@@ -117,11 +118,12 @@ class proxy
|
|
|
|
|
|
$mchid = $order->mchid();
|
|
|
$mch_order = $order->mch_order();
|
|
|
+ $order_time = $order->order_time();
|
|
|
|
|
|
- $refill_order = Model('refill_order');
|
|
|
+ $mod_refill = Model('refill_order');
|
|
|
if($order->first_commit()) {
|
|
|
refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_SEND);
|
|
|
- $refill_order->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
+ $mod_refill->partition(util::part_refill($order_time))->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
}
|
|
|
Log::record("proxy::add times={$order->commit_times()} mch_order={$mch_order} card_no = {$order->card_no()} regin_no={$order->region_no()} org_quality={$order->org_quality()} quality={$order->cur_quality()}",Log::DEBUG);
|
|
|
|
|
@@ -194,7 +196,7 @@ class proxy
|
|
|
{
|
|
|
$params['order_id'] = $order_id;
|
|
|
if($order_id > 0) {
|
|
|
- $refill_order->edit($order_id, ['is_retrying' => 1]);
|
|
|
+ $mod_refill->partition(util::part_refill($order_time))->edit($order_id, ['is_retrying' => 1]);
|
|
|
}
|
|
|
|
|
|
$params = $order->queue_params();
|
|
@@ -266,15 +268,16 @@ class proxy
|
|
|
$order = refill\order::from_parameters($params);
|
|
|
$mchid = $order->mchid();
|
|
|
$mch_order = $order->mch_order();
|
|
|
+ $order_time = $order->order_time();
|
|
|
|
|
|
refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_SEND);
|
|
|
- Model('refill_order')->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
+ Model('refill_order')->partition(util::part_refill($order_time))->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
|
|
|
[$org_quality,$quality] = refill\RefillFactory::instance()->find_quality($order);
|
|
|
Log::record("proxy::add mch_order={$mch_order} card_no = {$order->card_no()} regin_no={$order->region_no()} org_quality={$org_quality} quality={$quality}",Log::DEBUG);
|
|
|
$order_id = refill\RefillFactory::instance()->zero_order($order,"手动0元订单");
|
|
|
|
|
|
- refill\util::pop_queue_order($mchid, $mch_order);
|
|
|
+ refill\util::pop_queue_order($mchid, $mch_order, $order_time);
|
|
|
QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => false]);
|
|
|
}
|
|
|
|
|
@@ -321,10 +324,11 @@ class proxy
|
|
|
|
|
|
$mchid = $order->mchid();
|
|
|
$mch_order = $order->mch_order();
|
|
|
+ $order_time = $order->order_time();
|
|
|
|
|
|
- $refill_order = Model('refill_order');
|
|
|
+ $mod_refill = Model('refill_order');
|
|
|
refill\util::push_queue_order($mchid,$mch_order,ORDER_STATE_SEND);
|
|
|
- $refill_order->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
+ $mod_refill->partition(util::part_refill($order_time))->edit_detail($mchid,$mch_order,['order_state' => ORDER_STATE_SEND]);
|
|
|
|
|
|
$mch_amount = refill\RefillFactory::instance()->mch_amount($order);
|
|
|
if ($mch_amount === false) {
|