diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 7f256fe1a..a50baf6c9 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -458,7 +458,7 @@ class OrderLogic extends BaseLogic $money=$financeFlow->where(['order_id'=>$order['id'],'financial_pm'=>1,'financial_type'=>2])->value('number'); $financeFlowLogic->updateStatusStore($order['id'],$order['store_id'],$money,$deposit); - $check = Db::name('user_sign_log')->where('order_id',$order['order_id']) + /* $check = Db::name('user_sign_log')->where('order_id',$order['order_id']) ->where(['status'=>0]) ->find();//$check['number']扣的 if($check){ @@ -468,7 +468,7 @@ class OrderLogic extends BaseLogic $base = UserSign::where([ 'uid'=>$order['uid'], 'type'=>1, - 'status'=>0 + 'status'=>1 ])->find(); $user_sing = new UserSign(); if($base['number'] > 0 && $base['number'] >= $check['number']){ @@ -513,7 +513,7 @@ class OrderLogic extends BaseLogic } Db::name('user_sign_log')->where('order_id',$order['order_id'])->update(['status'=>1]); - } + }*/ Db::commit(); return true; diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index bca087b71..8c03f4776 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -206,15 +206,15 @@ class PayNotifyLogic extends BaseLogic OrderLogic::writeOff($params); } self::dealProductLog($order); - $count = UserSign::where([ - 'uid'=>$order['uid'], - 'type'=>1, - 'status'=>0 - ])->count(); - - if($count){ - self::addFlowLog($order); - } +// $count = UserSign::where([ +// 'uid'=>$order['uid'], +// 'type'=>1, +// 'status'=>0 +// ])->count(); +// +// if($count){ +// self::addFlowLog($order); +// } // if($order['shipping_type'] == 3){ // self::descStock($order['id']); // } @@ -234,15 +234,14 @@ class PayNotifyLogic extends BaseLogic 'type'=>1, 'status'=>0 ]); - $query1 = clone $query; - $ids = $query->column('id'); +// $query1 = clone $query; +// $ids = $query->column('id'); $check = $query->sum('number'); - $count = $query1->count(); +// $count = $query1->count(); if($check && $check >0){ $backPurchase = bcmul($order['pay_price'],0.1,2); - - if($count == 1){ +// if($count == 1){ //存在拆单子否 //少了就冻结减去这个对应的金额 $one = UserSign::where([ @@ -257,13 +256,15 @@ class PayNotifyLogic extends BaseLogic 'title' => '充值获得冻结兑换券', 'financial_pm' => 1, 'type' => 1, + 'status' => 1, ]; - if($one['back_num'] >= $backPurchase){ -// $wait = bcsub($one['back_num'],$backPurchase,2)??0; + if($one['number'] >= $backPurchase){ +// $wait = bcsub($one['number'],$backPurchase,2)??0; $data['number'] =$backPurchase; Db::name('user_sign_log')->insert($data); + //总的减去采购款百分之十剩余的 // if(empty($wait)){ // UserSign::where('id',$one['id'])->update( @@ -355,7 +356,7 @@ class PayNotifyLogic extends BaseLogic }*/ - } +// } return true; } @@ -613,10 +614,12 @@ class PayNotifyLogic extends BaseLogic 'financial_pm' => 1, 'store_id' => $order['store_id'], 'type' => 1, + 'status' => 1, 'number' => $total_vip, 'back_num' => $total_vip, ]; $user_sing->save($sing); + User::where('id',$order->uid)->inc('integral',$total_vip)->update(); return true; } @@ -666,7 +669,12 @@ class PayNotifyLogic extends BaseLogic if($order['other_uid']>0){ $uid=$order['other_uid']; } - self::dealRechargeFrozen($order); + $check = UserSign::where(['uid'=>$order->uid,'type'=>1])->count(); + if(empty($check)){ + self::dealRechargeFrozen($order); + + } + PushService::push('wechat_mmp_' . $uid, $uid, ['type'=>'INDUSTRYMEMBERS','msg'=>'订单支付成功','data'=>['id'=>$order['id'],'paid'=>1]]); PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type'=>'INDUSTRYMEMBERS','msg'=>'订单支付成功','data'=>['id'=>$order['id'],'paid'=>1]]); if (!empty($extra['payer']['openid'])) {