分红点兑积分自动减少

main
fengxinyhyl 8 months ago
parent eabf95cbe0
commit eee9f3cea9
  1. 7
      app/common/repositories/user/UserAssetsRepository.php

@ -207,6 +207,13 @@ class UserAssetsRepository extends BaseRepository
$share = floor(($shareStatistics->current - $shareStatistics->last_point) / $config['share_get_welfare_limit']);
$shareStatistics->last_point = $shareStatistics->last_point + $config['share_get_welfare_limit'] * $share;
$shareStatistics->save();
$logList[] = array(
'uid' => $item['uid'],
'asset_type' => UserAssetsLogRepository::ASSET_TYPE_SHARE_POINT,
'type' => UserAssetsLogRepository::CHANGE_TYPE_SHARE_GET,
'status' => UserAssetsLogRepository::STATUS_SUCCESS,
'count' => -$share,
);
$this->update($item['uid'], array('share_point' => $assets['share_point'] - $share));
}
}

Loading…
Cancel
Save