From dd20b32557a9bc40378f7a68097fdafaa30d9ff5 Mon Sep 17 00:00:00 2001
From: huangsijun <1773182001@qq.com>
Date: Thu, 11 Dec 2025 16:07:23 +0800
Subject: [PATCH] 阿里云图片上传修改

---
 admin/app/common/model/release/SupplyUser.php |   67 +++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/admin/app/common/model/release/SupplyUser.php b/admin/app/common/model/release/SupplyUser.php
new file mode 100644
index 0000000..2c408ab
--- /dev/null
+++ b/admin/app/common/model/release/SupplyUser.php
@@ -0,0 +1,67 @@
+<?php
+
+namespace app\common\model\plus\release;
+
+use app\common\model\BaseModel;
+
+
+/**
+ * 用户模型
+ */
+class SupplyUser extends BaseModel
+{
+    protected $name = 'release_supply_user';
+    protected $pk = 'user_id';
+
+    /**
+     * 关联会员记录表
+     * @return \think\model\relation\BelongsTo
+     */
+    public function user()
+    {
+        return $this->belongsTo('app\\common\\model\\user\\User');
+    }
+
+
+    /**
+     * 详情
+     */
+    public static function detail($user_id, $with = ['user'])
+    {
+        return (new static())->with($with)->find($user_id);
+    }
+
+    /**
+     * 详情
+     */
+    public static function getAll()
+    {
+        return (new static())->where("is_delete","=",0)->select();
+    }
+
+    /**
+     * 是否为供应方
+     */
+    public static function isSupplyUser($user_id)
+    {
+        $supply = self::detail($user_id);
+        return !!$supply && !$supply['is_delete'];
+    }
+
+    /**
+     * 新增记录
+     * @param $user_id
+     * @param $data
+     * @return bool
+     */
+    public static function add($user_id, $data)
+    {
+        $model = static::detail($user_id) ?: new static;
+         $model->save(array_merge([
+            'user_id' => $user_id,
+            'is_delete' => 0,
+            'app_id' => $model::$app_id,
+        ], $data));
+        return true;
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.2