From a4b3ee325c7354579d495bc74a777e494e5ec38c Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Fri, 06 Feb 2026 18:18:44 +0800
Subject: [PATCH] 商品可以价格面议 选择走访时显示输入走访企业名 分会添加活动时要总会审核 分类添加人数限制,添加活动选择了填写人数限制的分类时活动名额下显示该分类人数限制为15 同一个企业30天内只能走访一次,在30天内走访同一个企业时提示该企业已被走访xx天后才可以从新走访

---
 admin/app/api/controller/user/Team.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/admin/app/api/controller/user/Team.php b/admin/app/api/controller/user/Team.php
index ced8154..b4f352b 100644
--- a/admin/app/api/controller/user/Team.php
+++ b/admin/app/api/controller/user/Team.php
@@ -1 +1 @@
-<?php

namespace app\api\controller\user;

use app\api\controller\Controller;
use app\api\model\plus\team\Referee;
use app\api\model\plus\team\Setting;
use app\api\model\plus\team\User as TeamUserModel;
use app\api\model\plus\team\Apply as TeamApplyModel;
use app\api\model\settings\Message as MessageModel;
use app\common\model\plus\team\Referee as TeamRefereeModel;
use app\api\model\plus\agent\User as AgentUserModel;

/**
 * 分销中心
 */
class Team extends Controller
{
    // 用户
    private $user;
    // 队长
    private $team;
    // 分销设置
    private $setting;

    /**
     * 构造方法
     */
    public function initialize()
    {
        // 用户信息
        $this->user = $this->getUser();
        // 队长用户信息
        $this->team = TeamUserModel::detail($this->user['user_id'],['user', 'referee','grade']);
        // 队长设置
        $this->setting = Setting::getAll();
		// 分销商用户信息
		$this->agent = AgentUserModel::detail($this->user['user_id']);
    }

    /**
     * 队长中心
     */
    public function center()
    {
        //如果不是队长,列出条件 by lyzflash
        $is_team = $this->isTeamUser();
        $setting = $this->setting['basic']['values'];
        $agent_total = $agent_money = 0;

        //统计下级分销商总数
        if ($setting['become'] == '40' && $this->agent) {
            $agent_total = $this->agent['first_num'] + $this->agent['second_num']+ $this->agent['third_num'];
        }

        // 累计佣金
        if ($setting['become'] == '50' && $this->agent) {
            $agent_money = $this->agent['total_money'];
        }

        return $this->renderSuccess('', [
			// 当前是否为分销商
			'is_agent' => $this->isAgentUser(),
            // 当前是否为队长
            'is_team' => $is_team,
            // 当前是否在申请中
            'is_applying' => TeamApplyModel::isApplying($this->user['user_id']),
            // 当前用户信息
            'user' => $this->user,
            // 队长用户信息
            'team' => $this->team,
            // 背景图
            'background' => $this->setting['background']['values']['index'],
            // 页面文字
            'words' => $this->setting['words']['values'],
			//'teamnum'=>count($user_ids),
            // 下级分销商总数
            'agent_total' => $agent_total,
            // 累计佣金
            'agent_money' => $agent_money,
            'setting' => $setting
        ]);
    }

    /**
     * 队长申请状态
     */
    public function apply($referee_id = null, $platform= '')
    {
        return $this->renderSuccess('', [
            // 当前是否为队长
            'is_team' => $this->isTeamUser(),
            // 当前是否在申请中
            'is_applying' => TeamApplyModel::isApplying($this->user['user_id']),
            // 背景图
            'background' => $this->setting['background']['values']['apply'],
            // 页面文字
            'words' => $this->setting['words']['values'],
            // 申请协议
            'license' => $this->setting['license']['values']['license'],
            // 如果来源是小程序, 则获取小程序订阅消息id.获取售后通知.
            'template_arr' => MessageModel::getMessageByNameArr($platform, ['team_apply_user']),
        ]);
    }

    /**
     * 队长提现信息
     */
    public function cash($platform = '')
    {
        // 如果来源是小程序, 则获取小程序订阅消息id.获取售后通知.
        $template_arr = MessageModel::getMessageByNameArr($platform, ['team_cash_user']);
        return $this->renderSuccess('', [
            // 队长用户信息
            'team' => $this->team,
            // 结算设置
            'settlement' => $this->setting['settlement']['values'],
            // 背景图
            'background' => $this->setting['background']['values']['cash_apply'],
            // 页面文字
            'words' => $this->setting['words']['values'],
            // 小程序消息
            'template_arr' => $template_arr
        ]);
    }

    /**
     * 当前用户是否为队长
     */
    private function isTeamUser()
    {
        return !!$this->team && !$this->team['is_delete'];
    }

	/**
	 * 当前用户是否为分销商
	 */
	private function isAgentUser()
	{
	    return !!$this->agent && !$this->agent['is_delete'];
	}
}
\ No newline at end of file
+<?php

namespace app\api\controller\user;

use app\api\controller\Controller;
use app\api\model\plus\team\Referee;
use app\api\model\plus\team\Setting;
use app\api\model\plus\team\User as TeamUserModel;
use app\api\model\plus\team\Apply as TeamApplyModel;
use app\api\model\settings\Message as MessageModel;
use app\common\model\plus\team\Referee as TeamRefereeModel;
use app\api\model\plus\agent\User as AgentUserModel;
use app\common\model\product\Product as ProductModel;
use app\common\model\user\Grade as GradeModel;

/**
 * 分销中心
 */
class Team extends Controller
{
    // 用户
    private $user;
    // 队长
    private $team;
    // 分销设置
    private $setting;

    /**
     * 构造方法
     */
    public function initialize()
    {
        // 用户信息
        $this->user = $this->getUser();
        // 队长用户信息
        $this->team = TeamUserModel::detail($this->user['user_id'],['user', 'referee','grade']);
        // 队长设置
        $this->setting = Setting::getAll();
		// 分销商用户信息
		$this->agent = AgentUserModel::detail($this->user['user_id']);
    }

    /**
     * 队长中心
     */
    public function center()
    {
        //如果不是队长,列出条件 by lyzflash
        $is_team = $this->isTeamUser();
        $setting = $this->setting['basic']['values'];
        $agent_total = $agent_money = 0;

        //统计下级分销商总数
        if ($setting['become'] == '40' && $this->agent) {
            $agent_total = $this->agent['first_num'] + $this->agent['second_num']+ $this->agent['third_num'];
        }

        // 累计佣金
        if ($setting['become'] == '50' && $this->agent) {
            $agent_money = $this->agent['total_money'];
        }
        // 购买商品
        $productList = [];
        if ($setting['become'] == '70') {
            if ($setting['team_buy_product_ids']) {
                $productList = (new ProductModel)->getListByIds($setting['team_buy_product_ids']);
            }
        }
        $gradeList=[];
        if ($setting['become'] == '70') {
            if ($setting['referee_grade_ids']) {
                $gradeList = (new GradeModel)->getListByIds($setting['referee_grade_ids']);
            }
        }
        return $this->renderSuccess('', [
			// 当前是否为分销商
			'is_agent' => $this->isAgentUser(),
            // 当前是否为队长
            'is_team' => $is_team,
            // 当前是否在申请中
            'is_applying' => TeamApplyModel::isApplying($this->user['user_id']),
            // 当前用户信息
            'user' => $this->user,
            // 队长用户信息
            'team' => $this->team,
            // 背景图
            'background' => $this->setting['background']['values']['index'],
            // 页面文字
            'words' => $this->setting['words']['values'],
			//'teamnum'=>count($user_ids),
            // 下级分销商总数
            'agent_total' => $agent_total,
            // 累计佣金
            'agent_money' => $agent_money,
            // 购买商品
            'productList' => $productList,
            // 购买等级
            'gradeList' => $gradeList,
            'setting' => $setting
        ]);
    }

    /**
     * 队长申请状态
     */
    public function apply($referee_id = null, $platform= '')
    {
        return $this->renderSuccess('', [
            // 当前是否为队长
            'is_team' => $this->isTeamUser(),
            // 当前是否在申请中
            'is_applying' => TeamApplyModel::isApplying($this->user['user_id']),
            // 背景图
            'background' => $this->setting['background']['values']['apply'],
            // 页面文字
            'words' => $this->setting['words']['values'],
            // 申请协议
            'license' => $this->setting['license']['values']['license'],
            // 如果来源是小程序, 则获取小程序订阅消息id.获取售后通知.
            'template_arr' => MessageModel::getMessageByNameArr($platform, ['team_apply_user']),
        ]);
    }

    /**
     * 队长提现信息
     */
    public function cash($platform = '')
    {
        // 如果来源是小程序, 则获取小程序订阅消息id.获取售后通知.
        $template_arr = MessageModel::getMessageByNameArr($platform, ['team_cash_user']);
        return $this->renderSuccess('', [
            // 队长用户信息
            'team' => $this->team,
            // 结算设置
            'settlement' => $this->setting['settlement']['values'],
            // 背景图
            'background' => $this->setting['background']['values']['cash_apply'],
            // 页面文字
            'words' => $this->setting['words']['values'],
            // 小程序消息
            'template_arr' => $template_arr
        ]);
    }

    /**
     * 当前用户是否为队长
     */
    private function isTeamUser()
    {
        return !!$this->team && !$this->team['is_delete'];
    }

	/**
	 * 当前用户是否为分销商
	 */
	private function isAgentUser()
	{
	    return !!$this->agent && !$this->agent['is_delete'];
	}
}
\ No newline at end of file

--
Gitblit v1.9.2