IntegralJob.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\jobs\integral;
  3. use crmeb\basic\BaseJobs;
  4. use crmeb\traits\QueueTrait;
  5. /**
  6. * 订单消息队列
  7. * Class OrderJob
  8. * @package app\jobs
  9. */
  10. class IntegralJob extends BaseJobs
  11. {
  12. use QueueTrait;
  13. public function dealOrderIntegral($order)
  14. {
  15. $integral_price =
  16. $total_price = $order['total_price'];
  17. $static_integral_ratio = sys_config('static_integral_ratio', 0);
  18. $give_static_integral = bcdiv(bcmul($total_price, $static_integral_ratio), 100, 2);
  19. }
  20. /**
  21. * 减积分
  22. * @param int $uid 用户
  23. * @param float $static 静态积分
  24. * @param float $action 动态积分
  25. * @param float $cash 资金池
  26. * @param int $link_id 关联ID
  27. * @param string $mark 备注
  28. */
  29. public function decIntegral(int $uid, float $static, float $action, float $cash, int $link_id = 0, string $mark = '')
  30. {
  31. }
  32. /**
  33. * 加积分
  34. * @param int $uid 用户
  35. * @param float $static 静态积分
  36. * @param float $action 动态积分
  37. * @param float $cash 资金池
  38. * @param int $link_id 关联ID
  39. * @param string $mark 备注
  40. */
  41. public function incIntegral(int $uid, float $static, float $action, float $cash, int $link_id = 0, string $mark = '')
  42. {
  43. }
  44. }