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/model/plus/release/SupplyProject.php |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/admin/app/api/model/plus/release/SupplyProject.php b/admin/app/api/model/plus/release/SupplyProject.php
index ba90cc3..6122f8a 100644
--- a/admin/app/api/model/plus/release/SupplyProject.php
+++ b/admin/app/api/model/plus/release/SupplyProject.php
@@ -6,6 +6,8 @@
 use app\common\model\plus\release\ReleaseProjectImage as ReleaseProjectImageModel;
 use app\common\model\plus\release\Tag as TagModel;
 use app\common\model\plus\release\ReleaseProjectTag as ReleaseProjectTagModel;
+use app\common\model\user\User as UserModel;
+use app\common\model\user\PointsLog as PointsLogModel;
 
 
 /**
@@ -31,7 +33,7 @@
     /**
      * 新增记录
      */
-    public function add($postdata,$supply)
+    public function add($postdata,$supply,$pay_price,$publish_rewards)
     {
         $data = json_decode($postdata["formData"],true);
         if (empty($data['name'])) {
@@ -57,6 +59,8 @@
             'category_id'=>$data["category_id"],
             'price'=>$data["price"],
             'content'=>$data["content"],
+            'product_content'=>$data["product_content"],
+            'product_case'=>$data["product_case"],
             'detail'=>$data["detail"],
             'project_type'=>1,
             'is_show'=>$data["is_show"],
@@ -69,13 +73,29 @@
             $save_data["finish_time"] = '';
         }
 
-          return $this->transaction(function () use ($data, $save_data) {
+          return $this->transaction(function () use ($data, $save_data,$pay_price,$publish_rewards) {
             // 记录内容
             $this->save($save_data);
             // 记录图片
             $this->saveAllImages($this['project_id'],$data);
             // 记录标签
             $this->saveTag($this['project_id'],$data);
+
+             //减少连盟币
+            if($pay_price>0){
+                (new UserModel())->where('user_id', '=', $save_data['user_id'])->dec('points',$pay_price)->update();
+                PointsLogModel::add([
+                    'user_id' => $save_data['user_id'],
+                    'value' => -$pay_price,
+                    'describe' => "发布供应消耗连盟币",
+                    'app_id' => $save_data['app_id'],
+                ]);
+
+            }
+            if($publish_rewards>0){
+                $user=(new UserModel())->where('user_id', '=', $save_data['user_id'])->find();
+                $user->setIncConsumption($publish_rewards,'发布供应奖励消费券');
+            }
             
             return $this['project_id'];
         });
@@ -108,6 +128,8 @@
             'category_id'=>$data["category_id"],
             'price'=>$data["price"],
             'content'=>$data["content"],
+            'product_content'=>$data["product_content"],
+            'product_case'=>$data["product_case"],
             'detail'=>$data["detail"],
             'is_show'=>$data["is_show"],
             'status'=>0,

--
Gitblit v1.9.2