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/shop/controller/supplier/Supplier.php | 32 ++++++++++++++++++++++++--------
1 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/admin/app/shop/controller/supplier/Supplier.php b/admin/app/shop/controller/supplier/Supplier.php
index 1130693..498d9cc 100644
--- a/admin/app/shop/controller/supplier/Supplier.php
+++ b/admin/app/shop/controller/supplier/Supplier.php
@@ -2,6 +2,8 @@
namespace app\shop\controller\supplier;
+use app\shop\model\user\UserAddress;
+use app\common\enum\supplier\SupplierType;
use app\shop\controller\Controller;
use app\shop\model\supplier\Supplier as SupplierModel;
use app\shop\model\supplier\Apply as ApplyModel;
@@ -23,6 +25,7 @@
*/
public function index()
{
+ $typeList = SupplierType::getTypeName();// 获取请求的供应商类型参数
//获取该角色管理的区域 by yj 2023.12.20
$shop_supplier_ids = SupplierModel::getSupplierIdsByUser($this->store['user']);
// 供应商列表
@@ -31,8 +34,11 @@
if(!empty($shop_supplier_ids)){
$postData["shop_supplier_ids"] = $shop_supplier_ids;
}
+ $supplier_type=$postData['supplier_type']??SupplierType::PHYSICAL;
+ // 根据供应商类型获取对应的分类
+ $category = CategoryModel::getALL(['category_type'=>$supplier_type]);
$list = $model->getList($postData);
- return $this->renderSuccess('', compact('list'));
+ return $this->renderSuccess('', compact('list','typeList','category'));
}
/**
@@ -41,13 +47,21 @@
public function add()
{
$model = new SupplierModel;
- $category = CategoryModel::getALL();
+ $typeList = SupplierType::getTypeName();
+
+ // 获取请求的供应商类型参数
+ $supplier_type = $this->request->get('supplier_type', 10); // 默认为10(实物)
+
+ // 根据供应商类型获取对应的分类
+ $category = CategoryModel::getALL(['category_type'=>$supplier_type]);
+
$region = AreaModel::getALL();
if($this->request->isGet()){
- return $this->renderSuccess('', compact('category','region'));
+ return $this->renderSuccess('', compact('category','region','typeList'));
}
+ $data = $this->postData();
// 新增记录
- if ($model->add($this->postData())) {
+ if ($model->add($data)) {
return $this->renderSuccess('', '添加成功');
}
return $this->renderError($model->getError() ?: '添加失败');
@@ -60,9 +74,8 @@
public function edit($shop_supplier_id)
{
$model = SupplierModel::detail($shop_supplier_id, ['logo', 'business', 'qyQrcode','superUser.user']);
- $category = CategoryModel::getALL();
+ $category = CategoryModel::getALL(['category_type'=>$model['supplier_type']]);
$region = AreaModel::getALL();
-
//获取站点设置
$storeValues=SettingModel::getItem('store');
$areaList=[];
@@ -73,7 +86,8 @@
if($this->request->isGet()){
return $this->renderSuccess('', compact('model','category','region','areaList'));
}
- if ($model->edit($this->postData())) {
+ $data = $this->postData();
+ if ($model->edit($data)) {
return $this->renderSuccess('', '更新成功');
}
return $this->renderError($model->getError() ?: '更新失败');
@@ -98,14 +112,16 @@
{
//获取该角色管理的区域 by yj 2023.12.20
$area_ids = SupplierModel::getAreaIdsByUser($this->store['user']);
+ $typeList = SupplierType::getTypeName();
// 供应商列表
$model = new ApplyModel;
$postData = $this->postData();
if(!empty($area_ids)){
$postData["area_ids"] = $area_ids;
}
+
$list = $model->getList($postData);
- return $this->renderSuccess('', compact('list'));
+ return $this->renderSuccess('', compact('list','typeList'));
}
/**
* 供应商待审核详情
--
Gitblit v1.9.2