美丽天天秒源码部分核心源码分享

最近在开发美丽天天秒系统中,对产品用户体验了解得非常深入,现在是社交电商时代,我们在开发程序的过程中基于社交属性的玩法,基于朋友关系分享利他属性去做电商程序的设计至关重要,美丽天天秒系统也是我在在开发电商系统中感触比较深的一款自驱行为的社交电商系统,开发团队从产品设计里面、系统底层架构、程序代码逻辑、用户体验等功能深入考虑等等……
以下代码段是美丽天天秒系统分销分润核心代码

public function regionAgentDetail()
    {
        $title = '区域代理';
        if (empty($this->uid)) {
            return $this->outMessage($title, null, '-9999', "无法获取会员登录信息");
        }
        $nfx_region_agent = new NfxRegionAgent();
        $shop_info = $nfx_region_agent->getShopRegionAgentConfig($this->instance_id);
        
        $region_agent_info = $nfx_region_agent->getPromoterRegionAgentValidDetail($this->instance_id, $this->uid);
        $address = new Address();
        $address_info = $address->getProvinceName($region_agent_info['agent_provinceid']);
        $agent_name = '省代';
        if ($region_agent_info['agent_type'] > 1) {
            $address_info .= $address->getCityName($region_agent_info['agent_cityid']);
            $agent_name = '市代';
        }
        if ($region_agent_info['agent_type'] > 2) {
            $address_info .= $address->getDistrictName($region_agent_info['agent_districtid']);
            $agent_name = '区代';
        }
        $nfx_user = new NfxUser();
        $user_account = $nfx_user->getNfxUserAccount($this->uid, $this->instance_id); // 佣金
        if ($region_agent_info["agent_type"] == 1) {
            $rate = $shop_info["province_rate"];
        } elseif ($region_agent_info["agent_type"] == 2) {
            $rate = $shop_info["city_rate"];
        } else {
            $rate = $shop_info["district_rate"];
        }
        $data = array(
            'agent_name' => $agent_name,
            'address_info' => $address_info,
            'commission_region_agent' => $user_account['commission_region_agent'],
            'rate' => $rate
        );
        return $this->outMessage($title, $data);
    }
    
    /**
     * 分销商申请检测
     */
    public function checkApplyPromoter()
    {
        $title = '分销商申请信息';
        if (empty($this->uid)) {
            return $this->outMessage($title, null, '-9999', "无法获取会员登录信息");
        }
        $reapply = isset($this->params['reapply']) ? $this->params['reapply'] : 0;
        // 分销商信息表
        $nfx_promoter = new NfxPromoter();
        $promoter_info = $nfx_promoter->getUserPromoter($this->uid);
        
        $shop_config = new NfxShopConfig();
        $nfx_shop_config = $shop_config->getShopConfigDetail();
        if ($nfx_shop_config['is_distribution_enable'] == 0) {
            return $this->outMessage($title, null, -10, '当前店铺未开启分销');
        }
        
        $promoter_info = empty($promoter_info) ? null : $promoter_info;
        
        // 获取店铺分销商等级
        $promoter_level = $nfx_promoter->getPromoterLevelAll($this->instance_id, "level_money asc");
        if (empty($promoter_level)) {
            return $this->outMessage($title, null, -10, '当前未设置分销商');
        }
        
        // 获取用户在本店的消费
        $member_service = new MemberService();
        $uid = $this->uid;
        $user_consume = $member_service->getShopUserConsume($uid);
        $data = array(
            'reapply' => $reapply,
            'user_consume' => $user_consume,
            'promoter_level' => $promoter_level,
            'promoter_info' => $promoter_info
        );
        return $this->outMessage($title, $data);
    }

在这里插入图片描述

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值