| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- /**
- * 商城 C 端分销接口
- * 用途:mallApp 我的分红页
- */
- namespace mall\controllers;
- use bizHd\distribution\classes\DistributionFlowClass;
- use bizHd\distribution\classes\DistributionOrderClass;
- use bizHd\distribution\classes\DistributionUserClass;
- use common\components\util;
- use Yii;
- class DistributionController extends BaseController
- {
- /**
- * 我的分红汇总
- */
- public function actionGetMyStat()
- {
- if (empty($this->customId)) {
- util::fail('请先选择花店');
- }
- try {
- $data = DistributionUserClass::getMallMyStat($this->shopId, $this->customId);
- util::success($data);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- /**
- * 分红变动明细
- */
- public function actionGetFlowList()
- {
- if (empty($this->customId)) {
- util::fail('请先选择花店');
- }
- try {
- $data = DistributionFlowClass::getFlowList($this->shopId, $this->customId);
- util::success($data);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- /**
- * 拉新客户列表(当前登录客户为邀请人)
- */
- public function actionGetInviteList()
- {
- if (empty($this->customId)) {
- util::fail('请先选择花店');
- }
- try {
- $data = DistributionUserClass::getInviteList($this->shopId, $this->customId);
- util::success($data);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- /**
- * 下线贡献分红明细(xhDistributionOrder)
- */
- public function actionGetContribOrderList()
- {
- if (empty($this->customId)) {
- util::fail('请先选择花店');
- }
- $buyerId = (int)Yii::$app->request->get('buyerId', 0);
- try {
- $data = DistributionOrderClass::getContribOrderList($this->shopId, $this->customId, $buyerId);
- util::success($data);
- } catch (\Exception $e) {
- util::fail($e->getMessage());
- }
- }
- }
|