commit
6ae8cc3011
@ -306,7 +306,7 @@ class StoreProductLogic extends BaseLogic
|
|||||||
throw new BusinessException('数据不存在');
|
throw new BusinessException('数据不存在');
|
||||||
}
|
}
|
||||||
$res = $data->restore();
|
$res = $data->restore();
|
||||||
StoreBranchProduct::where('product_id', $params['id'])->update(['delete_time' => null]);
|
StoreBranchProduct::where('product_id', $params['id'])->withTrashed()->update(['delete_time' => null]);
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class CodePaySend implements Consumer
|
|||||||
public function onConsumeFailure(\Throwable $exception, $package)
|
public function onConsumeFailure(\Throwable $exception, $package)
|
||||||
{
|
{
|
||||||
// 直接更改消息队列数据结构,将最大重试次数max_attempts字段设置为0,即不再重试。
|
// 直接更改消息队列数据结构,将最大重试次数max_attempts字段设置为0,即不再重试。
|
||||||
if($package['attempts'] ==$exception['max_attempts']){
|
if($package['attempts'] == 12){
|
||||||
$pay = new PayService();
|
$pay = new PayService();
|
||||||
$data = [
|
$data = [
|
||||||
'order_id' => $package['data']['order_id'],
|
'order_id' => $package['data']['order_id'],
|
||||||
|
@ -43,29 +43,6 @@ class Task
|
|||||||
//删除未充值的订单
|
//删除未充值的订单
|
||||||
UserRecharge::where('paid', 0)->where('status', 1)->where('create_time', '<', $oneHourAgo)->update(['delete_time' => time()]);
|
UserRecharge::where('paid', 0)->where('status', 1)->where('create_time', '<', $oneHourAgo)->update(['delete_time' => time()]);
|
||||||
});
|
});
|
||||||
//每10秒执行一次
|
|
||||||
new Crontab('*/10 * * * * *', function () {
|
|
||||||
$select=Db::name('wechat_micropay')->limit(100)->select();
|
|
||||||
$pay = new PayService();
|
|
||||||
foreach ($select as $k=>$v) {
|
|
||||||
$time = time();
|
|
||||||
if ($time - $v['create_time'] > 60){
|
|
||||||
Db::name('wechat_micropay')->where('id',$v['id'])->delete();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$order = [
|
|
||||||
'out_trade_no' => $v['order_id'],
|
|
||||||
];
|
|
||||||
$res = $pay->wechat->query($order);
|
|
||||||
if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') {
|
|
||||||
if(isset($data['pay_type']) && $data['pay_type']=='recharge'){
|
|
||||||
PayNotifyLogic::handle('recharge', $res['out_trade_no'], $res);
|
|
||||||
}else{
|
|
||||||
PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->updateProductPrice();
|
$this->updateProductPrice();
|
||||||
$this->confirmProductPrice();
|
$this->confirmProductPrice();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user