ApiCommissionSetting.Class.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * 前台分销商设置Controller
  4. * Created by PhpStorm.
  5. * User: haoren
  6. * Date: 2020/07/22
  7. * Time: 15:00
  8. */
  9. namespace JinDouYun\Controller\Commission;
  10. use Exception;
  11. use Mall\Framework\Core\ErrorCode;
  12. use Mall\Framework\Core\StatusCode;
  13. use JinDouYun\Controller\BaseController;
  14. use JinDouYun\Model\Commission\MCommissionSetting;
  15. class ApiCommissionSetting extends BaseController
  16. {
  17. private $objMCommissionSetting;
  18. public function __construct($isCheckAcl = false, $isMustLogin = true, $checkToken=true)
  19. {
  20. parent::__construct($isCheckAcl, $isMustLogin, $checkToken);
  21. $this->objMCommissionSetting = new MCommissionSetting($this->onlineEnterpriseId, $this->onlineUserId);
  22. }
  23. /**
  24. * 查询设置
  25. * @throws Exception
  26. */
  27. public function getSetting()
  28. {
  29. $modelResult = $this->objMCommissionSetting->getSetting(true, true);
  30. if(!$modelResult->isSuccess()){
  31. parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode());
  32. }
  33. parent::sendOutput($modelResult->getData());
  34. }
  35. /**
  36. * 查询商品
  37. * @throws Exception
  38. */
  39. public function getBuyGoods()
  40. {
  41. $modelResult = $this->objMCommissionSetting->getBuyGoods();
  42. if(!$modelResult->isSuccess()){
  43. parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode());
  44. }
  45. parent::sendOutput($modelResult->getData());
  46. }
  47. /**
  48. * 查询文字设置
  49. */
  50. public function getTxtSetting()
  51. {
  52. $modelResult = $this->objMCommissionSetting->getTxtSetting();
  53. if(!$modelResult->isSuccess()){
  54. parent::sendOutput($modelResult->getData(), $modelResult->getErrorCode());
  55. }
  56. parent::sendOutput($modelResult->getData());
  57. }
  58. }