Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
a54cc8adac
@ -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;
|
||||
|
@ -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(
|
||||
@ -300,10 +301,10 @@ class PayNotifyLogic extends BaseLogic
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
/* else{
|
||||
//大于0的时候
|
||||
//先处理金额大的再处理剩余的
|
||||
/**** 把所有的金额改为正的再加一条后再加***/
|
||||
//把所有的金额改为正的再加一条后再加
|
||||
UserSign::where([
|
||||
'uid'=>$order['uid'],
|
||||
'type'=>1,
|
||||
@ -353,9 +354,9 @@ class PayNotifyLogic extends BaseLogic
|
||||
// User::where('id',$order['uid'])->inc('purchase_funds',$check)->update();//add
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
// }
|
||||
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;
|
||||
}
|
||||
@ -660,7 +663,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'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user