添加补贴记录
This commit is contained in:
parent
d595e04b2f
commit
39d46328df
@ -51,6 +51,7 @@ class StoreConsumptionUserDao extends BaseDao
|
|||||||
|
|
||||||
public $startTime;
|
public $startTime;
|
||||||
public $endTime;
|
public $endTime;
|
||||||
|
public $billExtra;
|
||||||
|
|
||||||
protected function getModel(): string
|
protected function getModel(): string
|
||||||
{
|
{
|
||||||
@ -272,6 +273,9 @@ class StoreConsumptionUserDao extends BaseDao
|
|||||||
} else {
|
} else {
|
||||||
$extra['group_order_id'] = $groupOrderIds;
|
$extra['group_order_id'] = $groupOrderIds;
|
||||||
}
|
}
|
||||||
|
if (!empty($this->billExtra)) {
|
||||||
|
$extra = array_merge($extra, $this->billExtra);
|
||||||
|
}
|
||||||
$userBillRepository->incBill($userId, 'red_pack', "red_pack_{$type}", [
|
$userBillRepository->incBill($userId, 'red_pack', "red_pack_{$type}", [
|
||||||
'link_id' => $model['coupon_user_id'],
|
'link_id' => $model['coupon_user_id'],
|
||||||
'status' => $status == -1 ?: 1,
|
'status' => $status == -1 ?: 1,
|
||||||
|
@ -39,6 +39,11 @@ class SendSubsidyCouponListen extends TimerService implements ListenerInterface
|
|||||||
//补贴金额为当前补贴减去已获得的补贴
|
//补贴金额为当前补贴减去已获得的补贴
|
||||||
$amount = bcsub($item['subsidy'], $gotSubsidy, 2);
|
$amount = bcsub($item['subsidy'], $gotSubsidy, 2);
|
||||||
$consumptionRepo = new StoreConsumptionUserDao();
|
$consumptionRepo = new StoreConsumptionUserDao();
|
||||||
|
$consumptionRepo->billExtra = [
|
||||||
|
'coupon_id' => $consumption['coupon_id'],
|
||||||
|
'sale_amount' => $item['amount'],
|
||||||
|
'purchase_amount' => $purchaseAmount,
|
||||||
|
];
|
||||||
$consumptionRepo->send($consumption, 1, $merchant->uid, 0, $amount, StoreConsumptionUser::STATUS_UNUSED, StoreConsumptionUser::TYPE_TWO);
|
$consumptionRepo->send($consumption, 1, $merchant->uid, 0, $amount, StoreConsumptionUser::STATUS_UNUSED, StoreConsumptionUser::TYPE_TWO);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user