From df60073f4fb06ea2d16984635e0714bae8a1f8e9 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Mon, 22 Dec 2025 18:03:35 +0800
Subject: [PATCH] 1.在总后台首页装修增加了活动专区和智能匹配 模块 2.目前活动专区获取的是发布需求最新的数据,智能匹配是用户没登录前也是获取发布需求最新数据,登录后会根据用户发布的需求,通过分类匹配到对应的数据 3.修复缴纳保证金报错 4.修复发布需求报错

---
 admin/app/supplier/controller/product/Product.php |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/admin/app/supplier/controller/product/Product.php b/admin/app/supplier/controller/product/Product.php
index 1381fc0..865c090 100644
--- a/admin/app/supplier/controller/product/Product.php
+++ b/admin/app/supplier/controller/product/Product.php
@@ -4,10 +4,11 @@
 
 use app\common\model\settings\Setting;
 use app\supplier\model\product\Product as ProductModel;
-use app\common\model\product\Category as CategoryModel;
+use app\supplier\model\product\Category as CategoryModel;
 use app\supplier\service\ProductService;
 use app\supplier\model\supplier\Supplier as SupplierModel;
 use app\supplier\controller\Controller;
+use think\facade\Cache;
 
 /**
  * 商品管理控制器
@@ -24,7 +25,8 @@
         $model = new ProductModel;
         $list = $model->getList(array_merge(['status' => -1, 'shop_supplier_id' => $this->getSupplierId()], $this->postData()));
         // 商品分类
-        $category = CategoryModel::getCacheTree();
+        $category = CategoryModel::getSupplierCacheTree($this->getSupplierId());
+
         // 数量
         $product_count = [
             'sell' => $model->getCount('sell', $this->getSupplierId()),
@@ -52,6 +54,7 @@
         $data = json_decode($this->postData()['params'], true);
         $data['is_newcomer'] = $supplier['is_newcomer'];
         $data['is_repurchase'] = $supplier['is_repurchase'];
+        $data['is_vip'] = $supplier['is_vip'];
         // 添加商品
         if($scene == 'copy'){
             unset($data['create_time']);
@@ -91,7 +94,7 @@
      */
     public function getBaseData($supplier)
     {
-        return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()),['is_newcomer'=>$supplier['is_newcomer'],'is_repurchase'=>$supplier['is_repurchase']]));
+        return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()),['is_newcomer'=>$supplier['is_newcomer'],'is_repurchase'=>$supplier['is_repurchase'],'is_vip'=>$supplier['is_vip']]));
     }
 
     /**
@@ -113,12 +116,13 @@
             $model = ProductModel::detail($product_id);
             $is_newcomer = $supplier['is_newcomer'];
             $is_repurchase = $supplier['is_repurchase'];
+            $is_vip = $supplier['is_vip'];
             $supplierName='';
             if($model['belonging_shop_supplier_id']){
                 $belonging_shop_supplier= SupplierModel::detail($model['belonging_shop_supplier_id']);
                 $supplierName=$belonging_shop_supplier['name'];
             }
-            return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model','is_newcomer','is_repurchase','supplierName')));
+            return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model','is_newcomer','is_repurchase','is_vip','supplierName')));
         }
         if ($scene == 'copy') {
             return $this->add($scene);
@@ -128,6 +132,7 @@
         $data = json_decode($this->postData()['params'], true);
         $data['is_newcomer'] = $supplier['is_newcomer'];
         $data['is_repurchase'] = $supplier['is_repurchase'];
+        $data['is_vip'] = $supplier['is_vip'];
         // 更新记录
         if ($model->edit($data,$this->getSupplierId())) {
             return $this->renderSuccess('更新成功');

--
Gitblit v1.9.2