Browse Source

分账service调整参数顺序

master
weigang 6 years ago
parent
commit
a23ebe451b
  1. 90
      app/Service/FinancialRecordService.php
  2. 90
      app/Service/FinancialRecordServiceInterface.php
  3. 16
      app/Service/SeparateAccountsService.php

90
app/Service/FinancialRecordService.php

@ -67,11 +67,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户奖励',
$comment='社区服务点',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_PLAT_NEW_USER,
$desc='新用户奖励',
$comment='社区服务点'
$money_type=FinancialRecord::MONEY_TYPE_CS_PLAT_NEW_USER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -95,11 +95,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户首单奖励',
$comment='社区服务点',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_FIRST_ORDER,
$desc='新用户首单奖励',
$comment='社区服务点'
$money_type=FinancialRecord::MONEY_TYPE_CS_FIRST_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -122,11 +122,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户订单分成',
$comment='社区服务点',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_OL_ORDER,
$desc='用户订单分成',
$comment='社区服务点'
$money_type=FinancialRecord::MONEY_TYPE_CS_OL_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -150,11 +150,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户下单奖励',
$comment='用户当面付商户奖励',
$user_type=FinancialRecord::USER_TYPE_STORE,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_STORE_PLAT_NEW_USER,
$desc='新用户下单奖励',
$comment='用户当面付商户奖励'
$money_type=FinancialRecord::MONEY_TYPE_STORE_PLAT_NEW_USER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -179,11 +179,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户店铺首单奖励',
$comment='用户当面付商户奖励',
$user_type=FinancialRecord::USER_TYPE_STORE,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_STORE_FIRST_ORDER,
$desc='用户店铺首单奖励',
$comment='用户当面付商户奖励'
$money_type=FinancialRecord::MONEY_TYPE_STORE_FIRST_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -227,11 +227,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户下单(线下)',
$comment='用户下单',
$user_type=FinancialRecord::USER_TYPE_USER,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_USER_OFL_ORDER,
$desc='用户下单(线下)',
$comment='用户下单'
$money_type=FinancialRecord::MONEY_TYPE_USER_OFL_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -244,11 +244,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户下单(线上)',
$comment='用户下单',
$user_type=FinancialRecord::USER_TYPE_USER,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_USER_OL_ORDER,
$desc='用户下单(线上)',
$comment='用户下单'
$money_type=FinancialRecord::MONEY_TYPE_USER_OL_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -261,11 +261,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '线上外卖订单收入',
$comment = '用户订单完成',
$user_type = FinancialRecord::USER_TYPE_STORE,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_STORE_OL_ORDER_COMP,
$desc = '线上外卖订单收入',
$comment = '用户订单完成'
$money_type = FinancialRecord::MONEY_TYPE_STORE_OL_ORDER_COMP
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -290,11 +290,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '线下当面付订单收入',
$comment = '用户订单完成',
$user_type = FinancialRecord::USER_TYPE_STORE,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP,
$desc = '线下当面付订单收入',
$comment = '用户订单完成'
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -321,11 +321,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '线上订单退款',
$comment = '线上订单退款到微信',
$user_type = FinancialRecord::USER_TYPE_USER,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_USER_OL_ORDER_REFUND,
$desc = '线上订单退款',
$comment = '线上订单退款到微信'
$money_type = FinancialRecord::MONEY_TYPE_USER_OL_ORDER_REFUND
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -338,11 +338,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '发展新用户',
$comment = '市场经理发展新用户奖励',
$user_type = FinancialRecord::USER_TYPE_MM,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_USER,
$desc = '市场经理发展新用户',
$comment = '市场经理发展新用户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_USER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -363,11 +363,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '发展新商户',
$comment = '市场经理发展新商户奖励',
$user_type = FinancialRecord::USER_TYPE_MM,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_STORE,
$desc = '市场经理发展新商户',
$comment = '市场经理发展新商户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_STORE
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -388,11 +388,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商发展新用户',
$comment = '服务商发展新用户奖励',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_USER,
$desc = '服务商发展新用户',
$comment = '服务商发展新用户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_USER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -413,11 +413,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商发展新商户',
$comment = '服务商发展新商户奖励',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_STORE,
$desc = '服务商发展新商户',
$comment = '服务商发展新商户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_STORE
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);
@ -438,11 +438,11 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商线上订单分账',
$comment = '服务商用户线上订单完成后分账',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_OL_ORDER,
$desc = '服务商线上订单分账',
$comment = '服务商用户线上订单完成后分账'
$money_type = FinancialRecord::MONEY_TYPE_MP_OL_ORDER
)
{
$this->recordAll($user_id, $source_id, $money, $user_type, $source_type, $money_type, $desc, $comment);

90
app/Service/FinancialRecordServiceInterface.php

@ -23,11 +23,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户奖励',
$comment='',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_PLAT_NEW_USER,
$desc='新用户奖励',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_CS_PLAT_NEW_USER
);
/**
@ -46,11 +46,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户首单奖励',
$comment='',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_FIRST_ORDER,
$desc='新用户首单奖励',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_CS_FIRST_ORDER
);
/**
@ -69,11 +69,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户订单分成',
$comment='',
$user_type=FinancialRecord::USER_TYPE_CS,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_CS_OL_ORDER,
$desc='用户订单分成',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_CS_OL_ORDER
);
/**
@ -104,11 +104,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='新用户下单奖励',
$comment='',
$user_type=FinancialRecord::USER_TYPE_STORE,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_STORE_PLAT_NEW_USER,
$desc='新用户下单奖励',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_STORE_PLAT_NEW_USER
);
/**
@ -127,11 +127,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户店铺首单奖励',
$comment='',
$user_type=FinancialRecord::USER_TYPE_STORE,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_STORE_FIRST_ORDER,
$desc='用户店铺首单奖励',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_STORE_FIRST_ORDER
);
/**
@ -150,11 +150,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户下单(线下)',
$comment='',
$user_type=FinancialRecord::USER_TYPE_USER,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_USER_OFL_ORDER,
$desc='用户下单(线下)',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_USER_OFL_ORDER
);
/**
@ -173,11 +173,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='用户下单(线上)',
$comment='',
$user_type=FinancialRecord::USER_TYPE_USER,
$source_type=FinancialRecord::SOURCE_TYPE_ORDER,
$money_type=FinancialRecord::MONEY_TYPE_USER_OL_ORDER,
$desc='用户下单(线上)',
$comment=''
$money_type=FinancialRecord::MONEY_TYPE_USER_OL_ORDER
);
/**
@ -196,11 +196,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='线上外卖订单收入',
$comment='',
$user_type = FinancialRecord::USER_TYPE_STORE,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_STORE_OL_ORDER_COMP,
$desc='线上外卖订单收入',
$comment=''
$money_type = FinancialRecord::MONEY_TYPE_STORE_OL_ORDER_COMP
);
/**
@ -219,11 +219,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='线下当面付订单收入',
$comment='',
$user_type = FinancialRecord::USER_TYPE_STORE,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP,
$desc='线下当面付订单收入',
$comment=''
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP
);
/**
@ -242,11 +242,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc='线上订单退款',
$comment='',
$user_type = FinancialRecord::USER_TYPE_STORE,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP,
$desc='线上订单退款',
$comment=''
$money_type = FinancialRecord::MONEY_TYPE_STORE_OFL_ORDER_COMP
);
/**
@ -264,11 +264,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '市场经理发展新用户',
$comment = '',
$user_type = FinancialRecord::USER_TYPE_MM,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_USER,
$desc = '市场经理发展新用户',
$comment = ''
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_USER
);
/**
@ -287,11 +287,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '市场经理发展新商户',
$comment = '市场经理发展新商户奖励',
$user_type = FinancialRecord::USER_TYPE_MM,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_STORE,
$desc = '市场经理发展新商户',
$comment = '市场经理发展新商户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MM_PLAT_NEW_STORE
);
/**
@ -310,11 +310,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商发展新用户',
$comment = '服务商发展新用户奖励',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_USER,
$desc = '服务商发展新用户',
$comment = '服务商发展新用户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_USER
);
/**
@ -333,11 +333,11 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商发展新商户',
$comment = '服务商发展新商户奖励',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_STORE,
$desc = '服务商发展新商户',
$comment = '服务商发展新商户奖励'
$money_type = FinancialRecord::MONEY_TYPE_MP_PLAT_NEW_STORE
);
/**
@ -356,10 +356,10 @@ interface FinancialRecordServiceInterface
$user_id,
$source_id,
$money,
$desc = '服务商线上订单分账',
$comment = '服务商用户线上订单完成后分账',
$user_type = FinancialRecord::USER_TYPE_MP,
$source_type = FinancialRecord::SOURCE_TYPE_ORDER,
$money_type = FinancialRecord::MONEY_TYPE_MP_OL_ORDER,
$desc = '服务商线上订单分账',
$comment = '服务商用户线上订单完成后分账'
$money_type = FinancialRecord::MONEY_TYPE_MP_OL_ORDER
);
}

16
app/Service/SeparateAccountsService.php

@ -194,8 +194,8 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
// 平台新用户
if ($this->userService->isPlatformNewUser($orderMain->user_id, $orderMain->id)) {
$ssdb->exec('hincr', $ssdbName, 'new_user_number', 1);
$this->financialRecordService->mmAwardByPlatNewUser($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_user']); // 市场经理新用户奖励
$this->financialRecordService->mpAwardByPlatNewUser($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_user']); // 服务商新用户奖励
$this->financialRecordService->mmAwardByPlatNewUser($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_user'], '发展新用户'); // 市场经理新用户奖励
$this->financialRecordService->mpAwardByPlatNewUser($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_user'], '市场经理「'.$mmInfo->name.'」发展新用户'); // 服务商新用户奖励
}
// 判断是否已经奖励过新拓展商户的奖励,没有的话判断新用户个数是否达到要求,进行奖励
@ -204,8 +204,8 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
&&$record['is_awarded']==0
&&$record['new_user_number']>=$MmMpAwardConfig['limit_new_user_number']
) { // 存在记录且未发放奖励,同时新用户数已经超过10
$this->financialRecordService->mmAwardByNewStore($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_store']); // 市场经理新商户奖励
$this->financialRecordService->mpAwardByNewStore($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_store']); // 服务商新商户奖励
$this->financialRecordService->mmAwardByNewStore($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_store'], '发展新商户【'.$store->name.'】'); // 市场经理新商户奖励
$this->financialRecordService->mpAwardByNewStore($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_store'], '市场经理「'.$mmInfo->name.'」发展新新商户【'.$store->name.'】'); // 服务商新商户奖励
}
}
@ -379,8 +379,8 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
// 平台新用户
if ($this->userService->isPlatformNewUser($orderMain->user_id, $orderMain->id)) {
$ssdb->exec('hincr', $ssdbName, 'new_user_number', 1);
$this->financialRecordService->mmAwardByPlatNewUser($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_user']); // 市场经理新用户奖励
$this->financialRecordService->mpAwardByPlatNewUser($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_user']); // 服务商新用户奖励
$this->financialRecordService->mmAwardByPlatNewUser($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_user'], '发展新用户'); // 市场经理新用户奖励
$this->financialRecordService->mpAwardByPlatNewUser($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_user'], '市场经理「'.$mmInfo->name.'」发展新用户'); // 服务商新用户奖励
}
// 判断是否已经奖励过新拓展商户的奖励,没有的话判断新用户个数是否达到要求,进行奖励
@ -389,8 +389,8 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface
&&$record['is_awarded']==0
&&$record['new_user_number']>=$MmMpAwardConfig['limit_new_user_number']
) { // 存在记录且未发放奖励,同时新用户数已经超过10
$this->financialRecordService->mmAwardByNewStore($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_store']); // 市场经理新商户奖励
$this->financialRecordService->mpAwardByNewStore($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_store']); // 服务商新商户奖励
$this->financialRecordService->mmAwardByNewStore($mmInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mm_new_store'], '发展新商户【'.$store->name.'】'); // 市场经理新商户奖励
$this->financialRecordService->mpAwardByNewStore($mpInfo->admin_user_id, $global_order_id, $MmMpAwardConfig['mp_new_store'], '市场经理「'.$mmInfo->name.'」发展新新商户【'.$store->name.'】'); // 服务商新商户奖励
}
// =======服务商、市场经理奖励分账 / End=======

Loading…
Cancel
Save