Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
ef7f100767
@ -46,7 +46,7 @@ class CommissionLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function setCook($order, $village_uid = 0, $brigade_uid = 0, $transaction_id = 0)
|
public static function setCook($order, $village_uid = 0, $brigade_uid = 0, $transaction_id = 0)
|
||||||
{
|
{
|
||||||
$user_1 = self::user($order, 0.07, $transaction_id, 0, 12); //会员、厨师
|
$user_1 = self::user($order, 0.07, $transaction_id, $order['spread_uid'], 12); //会员、厨师
|
||||||
$user_2 = self::user($order, 0.01, $transaction_id, $village_uid, 14); //村长
|
$user_2 = self::user($order, 0.01, $transaction_id, $village_uid, 14); //村长
|
||||||
$user_3 = self::user($order, 0.01, $transaction_id, $brigade_uid, 15); //队长
|
$user_3 = self::user($order, 0.01, $transaction_id, $brigade_uid, 15); //队长
|
||||||
|
|
||||||
|
@ -846,8 +846,10 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$financeLogic->out($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
|
$financeLogic->out($transaction_id, $order['pay_price'], OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']);
|
||||||
$financeLogic->save();
|
$financeLogic->save();
|
||||||
$user_ship = User::where('id', $order['uid'])->value('user_ship'); //会员不加兑换券
|
$user_ship = User::where('id', $order['uid'])->value('user_ship'); //会员不加兑换券
|
||||||
if ($order['uid'] > 0 && $order['total_price'] >= 500
|
if (
|
||||||
&& $order['pay_type'] !=PayEnum::PURCHASE_FUNDS && $user_ship !=1) {
|
$order['uid'] > 0 && $order['total_price'] >= 500
|
||||||
|
&& $order['pay_type'] != PayEnum::PURCHASE_FUNDS && $user_ship != 1
|
||||||
|
) {
|
||||||
$user_number = bcmul($order['pay_price'], '0.10', 2);
|
$user_number = bcmul($order['pay_price'], '0.10', 2);
|
||||||
$sing = [
|
$sing = [
|
||||||
'uid' => $order['uid'],
|
'uid' => $order['uid'],
|
||||||
@ -893,6 +895,29 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if ($order['spread_uid'] > 0 || $user_ship > 0) {
|
||||||
|
if ($order['spread_uid'] > 0 && $user_ship == 0) {
|
||||||
|
$user_ship = User::where('id', $order['spread_uid'])->value('user_ship');
|
||||||
|
if ($user_ship == 2) {
|
||||||
|
$village_uid = $order['spread_uid'];
|
||||||
|
$address = UserAddress::where(['uid' => $order['spread_uid'], 'is_default' => 1])->find();
|
||||||
|
if ($address) {
|
||||||
|
$arr2 = UserAddress::where(['village' => $address['village'], 'brigade' => $address['brigade'], 'is_default' => 1])->column('uid');
|
||||||
|
if ($arr2) {
|
||||||
|
$brigade_uid = User::where('id', 'in', $arr2)->where('user_ship', 3)->value('id') ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($user_ship == 3) {
|
||||||
|
$brigade_uid = $order['spread_uid'];
|
||||||
|
$address = UserAddress::where(['uid' => $order['spread_uid'], 'is_default' => 1])->find();
|
||||||
|
if ($address) {
|
||||||
|
$arr1 = UserAddress::where(['village' => $address['village'], 'is_default' => 1])->column('uid');
|
||||||
|
if ($arr1) {
|
||||||
|
$village_uid = User::where('id', 'in', $arr1)->where('user_ship', 2)->value('id') ?? 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
//查询用户对应的村长和队长
|
//查询用户对应的村长和队长
|
||||||
$address = UserAddress::where(['uid' => $order['uid'], 'is_default' => 1])->find();
|
$address = UserAddress::where(['uid' => $order['uid'], 'is_default' => 1])->find();
|
||||||
if ($address) {
|
if ($address) {
|
||||||
@ -905,9 +930,6 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$brigade_uid = User::where('id', 'in', $arr2)->where('user_ship', 3)->value('id') ?? 0;
|
$brigade_uid = User::where('id', 'in', $arr2)->where('user_ship', 3)->value('id') ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($order['spread_uid'] > 0 || $user_ship>0) {
|
|
||||||
if($order['spread_uid'] > 0 && $user_ship == 0){
|
|
||||||
$user_ship = User::where('id', $order['spread_uid'])->value('user_ship');
|
|
||||||
}
|
}
|
||||||
switch ($user_ship) {
|
switch ($user_ship) {
|
||||||
case 1: // 行业会员
|
case 1: // 行业会员
|
||||||
@ -1154,6 +1176,4 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
return "订单支付{$amount}元";
|
return "订单支付{$amount}元";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user