From 73b874c72ad55eb9eef21c36160ac0de58f0189e Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 05 Feb 2026 10:30:43 +0800
Subject: [PATCH] 优化名片
---
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