|
@@ -27,9 +27,12 @@ class handleYzOrderData extends Command
|
|
|
//处理有赞订单数据
|
|
|
protected function execute(Input $input, Output $output)
|
|
|
{
|
|
|
-
|
|
|
+ $limit = Cache::store('redis')->get("YzTimeLimit");
|
|
|
$c_data = Cache::store('redis')->handler()->rpop(Config::get('app.handle_queue_key'));
|
|
|
-
|
|
|
+ if($limit==1){
|
|
|
+ return '' ;
|
|
|
+ }
|
|
|
+ Cache::store('redis')->set("YzTimeLimit",1,60);
|
|
|
if ($c_data){
|
|
|
|
|
|
$c_data = json_decode($c_data, true);
|
|
@@ -46,6 +49,7 @@ class handleYzOrderData extends Command
|
|
|
if ($c_data['discount_price'] < $platform_yz_info['sale_price'] && $c_data['is_approved'] == '0') {
|
|
|
Db::rollback();
|
|
|
$this->callbackYz(['status' => 2, 'id' => $c_data['id'], 'reason' => '价格低于系统售价' . $platform_yz_info['sale_price']]);
|
|
|
+ Cache::store('redis')->set("YzTimeLimit",0);
|
|
|
return false;//停止执行后续代码
|
|
|
}
|
|
|
|
|
@@ -579,7 +583,7 @@ class handleYzOrderData extends Command
|
|
|
}
|
|
|
|
|
|
Db::commit();
|
|
|
-
|
|
|
+ Cache::store('redis')->set("YzTimeLimit",0);
|
|
|
$output->writeln(date('Y-m-d H:i:s') . '|处理成功,orderCode:' . $orderCode);
|
|
|
|
|
|
} catch (\think\Exception $exception) {
|
|
@@ -590,7 +594,7 @@ class handleYzOrderData extends Command
|
|
|
//回调更新有赞订单数据
|
|
|
$callback_rs = $this->callbackYz(['status' => 8, 'id' => $c_data['id'], 'reason' => $exception->getMessage()]);
|
|
|
if ($callback_rs['code'] != 0) $message[] = $callback_rs['message'];
|
|
|
-
|
|
|
+ Cache::store('redis')->set("YzTimeLimit",0);
|
|
|
$output->writeln(date('Y-m-d H:i:s') . '|处理失败,' . implode(',', $message));
|
|
|
}
|
|
|
|