AgentRateLogic.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * AgentRateLogic.php UTF-8
  4. *
  5. *
  6. * @date : 2018/5/24 13:59
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : luowei <lw@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huo\logic\agent;
  13. use huo\model\agent\AgentRateModel;
  14. use huo\model\common\CommonModel;
  15. class AgentRateLogic extends CommonModel {
  16. /**
  17. * 通过渠道ID获取折扣信息
  18. *
  19. * @param string $agent_id
  20. *
  21. * @return array|bool
  22. */
  23. public function getInfoByAgentId($agent_id) {
  24. $_info = (new AgentRateModel())->getDetail($agent_id);
  25. return $_info;
  26. }
  27. /**
  28. * 获取默认折扣信息
  29. *
  30. *
  31. * @return array|bool
  32. */
  33. public function getDefaultInfo() {
  34. $_info = (new AgentRateModel())->getDefaultDetail();
  35. return $_info;
  36. }
  37. /**
  38. * 更新数据
  39. *
  40. * @param array $data
  41. *
  42. * @param int $agent_id
  43. *
  44. * @return bool|mixed
  45. */
  46. public function updateAgentRate($data = [], $agent_id) {
  47. $_map['id'] = $agent_id;
  48. return (new AgentRateModel())->updateData($data, $agent_id);
  49. }
  50. /**
  51. * 添加渠道
  52. *
  53. * @param array $data
  54. *
  55. * @return bool|mixed
  56. */
  57. public function addAgentRate($data) {
  58. $_id = (new AgentRateModel())->addData($data);
  59. return $_id;
  60. }
  61. }